添加配置运行回调消息带上客户端信息
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.pojos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OutputClient {
|
||||
private int platform;
|
||||
private String clientId;
|
||||
|
||||
public OutputClient() {
|
||||
}
|
||||
|
||||
public OutputClient(int platform, String clientId) {
|
||||
this.platform = platform;
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
public int getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(int platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
public void setClientId(String clientId) {
|
||||
this.clientId = clientId;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class OutputMessageData {
|
||||
private MessagePayload payload;
|
||||
private List<String> toUsers;
|
||||
private long timestamp;
|
||||
private OutputClient client;
|
||||
|
||||
public String getSender() {
|
||||
return sender;
|
||||
@@ -69,7 +70,19 @@ public class OutputMessageData {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public OutputClient getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(OutputClient client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public static OutputMessageData fromProtoMessage(WFCMessage.Message protoMessage) {
|
||||
return fromProtoMessage(protoMessage, null);
|
||||
}
|
||||
|
||||
public static OutputMessageData fromProtoMessage(WFCMessage.Message protoMessage, OutputClient fromClient) {
|
||||
OutputMessageData data = new OutputMessageData();
|
||||
data.messageId = protoMessage.getMessageId();
|
||||
data.sender = protoMessage.getFromUser();
|
||||
@@ -80,6 +93,7 @@ public class OutputMessageData {
|
||||
data.payload = MessagePayload.fromProtoMessageContent(protoMessage.getContent());
|
||||
data.timestamp = protoMessage.getServerTimestamp();
|
||||
data.toUsers = protoMessage.getToList();
|
||||
data.client = fromClient;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user