Skip to content

Commit

Permalink
Merge pull request #462 from Kommunicate-io/CM-1762
Browse files Browse the repository at this point in the history
[CM-1762] Fixed user messages coming on right side in agent app
  • Loading branch information
PoojaGC authored Dec 19, 2023
2 parents 815a169 + 80acf67 commit f90f31e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The changelog for [Kommunicate-Android-Chat-SDK](https://github.com/Kommunicate-
## Unreleased
1) Fixed typing indicator for welcome message
2) Fixed "no conversations" showing sometimes for the first time when conversation is created
3) Fixed user messages coming on right side in agent app
## Kommunicate Android SDK 2.8.8
1) Fixed crash while deleting message on agent app
## Kommunicate Android SDK 2.8.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,20 @@ public void run() {
if (NOTIFICATION_TYPE.MESSAGE_SENT.getValue().equals(mqttMessageResponse.getType())) {
GcmMessageResponse messageResponse = (GcmMessageResponse) GsonUtils.getObjectFromJson(messageDataString, GcmMessageResponse.class);
Message sentMessageSync = messageResponse.getMessage();
if (sentMessageSync.getGroupId() != null) {

Channel channel = ChannelService.getInstance(context).getChannelByChannelKey(sentMessageSync.getGroupId());
if (channel != null && channel.getKmStatus() == Channel.NOTSTARTED_CONVERSATIONS && sentMessageSync.getGroupStatus() != null && !sentMessageSync.getGroupStatus().equals(Message.GroupStatus.INITIAL.getValue())) {
channel.setKmStatus(Channel.ALL_CONVERSATIONS);
ChannelService.getInstance(context).updateChannel(channel);
if (TextUtils.isEmpty(sentMessageSync.getTo()) ||
TextUtils.isEmpty(MobiComUserPreference.getInstance(context).getUserId()) ||
sentMessageSync.getTo().equals(MobiComUserPreference.getInstance(context).getUserId())) {
if (sentMessageSync.getGroupId() != null) {

Channel channel = ChannelService.getInstance(context).getChannelByChannelKey(sentMessageSync.getGroupId());
if (channel != null && channel.getKmStatus() == Channel.NOTSTARTED_CONVERSATIONS && sentMessageSync.getGroupStatus() != null && !sentMessageSync.getGroupStatus().equals(Message.GroupStatus.INITIAL.getValue())) {
channel.setKmStatus(Channel.ALL_CONVERSATIONS);
ChannelService.getInstance(context).updateChannel(channel);
}
}
syncCallService.syncMessages(sentMessageSync.getKeyString(), sentMessageSync);
}
syncCallService.syncMessages(sentMessageSync.getKeyString(), sentMessageSync);
}

if (NOTIFICATION_TYPE.USER_BLOCKED.getValue().equals(mqttMessageResponse.getType()) ||
Expand Down

0 comments on commit f90f31e

Please sign in to comment.