解决机器人回调配置带上发送人信息功能无效问题
This commit is contained in:
@@ -178,19 +178,10 @@ public class MessagesPublisher {
|
|||||||
if (message == null) {
|
if (message == null) {
|
||||||
message = m_messagesStore.getMessage(messageId);
|
message = m_messagesStore.getMessage(messageId);
|
||||||
}
|
}
|
||||||
OutputClient outputClient = null;
|
OutputMessageData outputMessageData = getOutputMessageWithExtraInfo(message, exceptClientId, m_messagesStore.isRobotCallbackWithClientInfo() , m_messagesStore.isRobotCallbackWithSenderInfo(), m_messagesStore.isRobotCallbackWithTargetInfo());
|
||||||
if(m_messagesStore.isRobotCallbackWithClientInfo() && !StringUtil.isNullOrEmpty(exceptClientId)) {
|
|
||||||
Session session = m_sessionsStore.getSession(exceptClientId);
|
|
||||||
if(session != null && session.getUsername().equals(sender)) {
|
|
||||||
outputClient = new OutputClient(session.getPlatform(), exceptClientId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final WFCMessage.Message finalMsg = message;
|
|
||||||
OutputClient finalOutputClient = outputClient;
|
|
||||||
Server.getServer().getCallbackScheduler().execute(() -> {
|
Server.getServer().getCallbackScheduler().execute(() -> {
|
||||||
try {
|
try {
|
||||||
HttpUtils.httpJsonPost(robot.getCallback(), GsonUtil.gson.toJson(OutputMessageData.fromProtoMessage(finalMsg, finalOutputClient), OutputMessageData.class), HttpUtils.HttpPostType.POST_TYPE_Robot_Message_Callback);
|
HttpUtils.httpJsonPost(robot.getCallback(), GsonUtil.gson.toJson(outputMessageData, OutputMessageData.class), HttpUtils.HttpPostType.POST_TYPE_Robot_Message_Callback);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Utility.printExecption(LOG, e, EVENT_CALLBACK_Exception);
|
Utility.printExecption(LOG, e, EVENT_CALLBACK_Exception);
|
||||||
|
|||||||
Reference in New Issue
Block a user