Files
IM-server-new/broker/src/main/java/cn/wildfirechat/push/PushMessage.java
T

83 lines
3.2 KiB
Java
Raw Normal View History

2019-03-16 17:04:23 +08:00
/*
* This file is part of the Wildfire Chat package.
* (c) Heavyrain2012 <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
package cn.wildfirechat.push;
public class PushMessage {
public String sender;
public String senderName;
public String senderPortrait;
2019-03-16 17:04:23 +08:00
public int convType;
public String target;
public String targetName;
public String targetPortrait;
2020-11-06 16:44:21 +08:00
public String userId;
2019-03-16 17:04:23 +08:00
public int line;
public int cntType;
public long serverTime;
//消息的类型,普通消息通知栏;voip要透传。
public int pushMessageType;
//推送类型,android推送分为小米/华为/魅族等。ios分别为开发和发布。
public int pushType;
public String pushContent;
2020-07-15 08:08:31 +08:00
public String pushData;
2019-03-16 17:04:23 +08:00
public int unReceivedMsg;
public int mentionedType;
public String packageName;
public String deviceToken;
public String voipDeviceToken;
public boolean isHiddenDetail;
public String language;
2024-09-12 21:29:03 +08:00
public boolean republish;
2021-09-20 08:21:16 +08:00
public long messageId;
public long callStartUid;
public int existBadgeNumber;
2019-03-16 17:04:23 +08:00
public PushMessage(String sender, int conversationType, String target, int line, int messageContentType, long serverTime, String senderName, String senderPortrait, String targetName, String targetPortrait, int unReceivedMsg, int mentionedType, boolean isHiddenDetail, String language) {
2019-03-16 17:04:23 +08:00
this.sender = sender;
this.convType = conversationType;
this.target = target;
this.senderName = senderName;
this.senderPortrait = senderPortrait;
2019-03-16 17:04:23 +08:00
this.targetName = targetName;
this.targetPortrait = targetPortrait;
2019-03-16 17:04:23 +08:00
this.line = line;
this.cntType = messageContentType;
this.serverTime = serverTime;
this.unReceivedMsg = unReceivedMsg;
2021-03-18 18:27:37 +08:00
if (cntType == 400 || cntType == 406) {
2020-10-22 10:32:51 +08:00
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_VOIP_INVITE;
} else if(cntType == 402) {
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_VOIP_BYE;
} else if(cntType == 401) {
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_VOIP_ANSWER;
2021-09-20 08:21:16 +08:00
} else if(cntType == 80) {
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_RECALLED;
} else if(cntType == 81) {
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_DELETED;
2020-10-22 10:32:51 +08:00
} else {
this.pushMessageType = PushServer.PushMessageType.PUSH_MESSAGE_TYPE_NORMAL;
}
2019-03-16 17:04:23 +08:00
this.mentionedType = mentionedType;
this.isHiddenDetail = isHiddenDetail;
this.language = language;
2024-09-12 21:29:03 +08:00
this.republish = messageContentType == 80 || messageContentType == 81;
2019-03-16 17:04:23 +08:00
}
2020-03-26 13:31:35 +08:00
public PushMessage(String sender, String target, long serverTime, String senderName, int unReceivedMsg, String language, int pushMessageType) {
this.sender = sender;
this.target = target;
this.senderName = senderName;
this.serverTime = serverTime;
this.unReceivedMsg = unReceivedMsg;
this.pushMessageType = pushMessageType;
this.language = language;
}
2019-03-16 17:04:23 +08:00
}