Skip to content

Commit

Permalink
添加黑名单接口,添加push消息参数
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyrain2012 committed Nov 22, 2019
1 parent 9062c37 commit 8393399
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions client/src/main/java/cn/wildfirechat/remote/ChatManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,33 @@ public void run() {
}
}

public boolean isBlackListed(String userId) {
if (!checkRemoteService()) {
return false;
}

try {
return mClient.isBlackListed(userId);
} catch (RemoteException e) {
e.printStackTrace();
}

return false;
}

public List<String> getBlackList(boolean refresh) {
if (!checkRemoteService()) {
return null;
}

try {
return mClient.getBlackList(refresh);
} catch (RemoteException e) {
e.printStackTrace();
}
return null;
}

public void setBlackList(String userId, boolean isBlacked, final GeneralCallback callback) {
if (!checkRemoteService()) {
if (callback != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class AndroidPushMessage implements Parcelable {
public int pushMessageType; //0 normal, 1 voip invite, 2 voip bye
public String pushContent;
public int unReceivedMsg;
public int mentionedType;
public boolean isHiddenDetail;

protected AndroidPushMessage(Parcel in) {
sender = in.readString();
Expand All @@ -35,6 +37,8 @@ protected AndroidPushMessage(Parcel in) {
pushMessageType = in.readInt();
pushContent = in.readString();
unReceivedMsg = in.readInt();
mentionedType = in.readInt();
isHiddenDetail = in.readInt()>0;
}

public static final Creator<AndroidPushMessage> CREATOR = new Creator<AndroidPushMessage>() {
Expand Down Expand Up @@ -67,6 +71,8 @@ public static AndroidPushMessage messageFromJson(String jsonString) throws JSONE
pushMessage.pushMessageType = jsonObject.getInt("pushMessageType");
pushMessage.pushContent = jsonObject.optString("pushContent");
pushMessage.unReceivedMsg = jsonObject.optInt("unReceivedMsg", 1);
pushMessage.mentionedType = jsonObject.optInt("mentionedType", 0);
pushMessage.isHiddenDetail = jsonObject.optBoolean("isHiddenDetail");
return pushMessage;
}

Expand All @@ -88,5 +94,7 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(pushMessageType);
dest.writeString(pushContent);
dest.writeInt(unReceivedMsg);
dest.writeInt(mentionedType);
dest.writeInt(isHiddenDetail?1:0);
}
}

0 comments on commit 8393399

Please sign in to comment.