Skip to content

Commit

Permalink
update insertMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
imndx committed Mar 30, 2021
1 parent 18b58da commit 6412b07
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions client/src/main/java/cn/wildfirechat/remote/ChatManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1424,14 +1424,20 @@ public Message insertMessage(Conversation conversation, String sender, long mess
Message message = new Message();
message.conversation = conversation;
message.content = content;
message.sender = sender;
message.status = status;
message.messageUid = messageUid;
message.serverTime = serverTime;
if (this.userId.equals(sender)) {
message.direction = MessageDirection.Send;
} else {

message.direction = MessageDirection.Send;
if(status.value() >= MessageStatus.Mentioned.value()){
message.direction = MessageDirection.Receive;
if(conversation.type == Conversation.ConversationType.Single){
message.sender = conversation.target;
}else {
message.sender = sender;
}
}else {
message.sender = getUserId();
}

try {
Expand Down

0 comments on commit 6412b07

Please sign in to comment.