From a6397b0392e9dd92a3397bafcac554925de39af4 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Wed, 22 Sep 2021 09:58:08 +0200 Subject: [PATCH] differentiate unread counters differentiate unread counters for group mentions and direct mentions Signed-off-by: Marcel Hibbe --- .../talk/adapters/items/ConversationItem.java | 38 ++++++++++++++++--- .../ConversationsListController.java | 2 +- .../json/conversations/Conversation.java | 11 ++++++ 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java index 30fbe3d2d..c9a5ed76e 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java @@ -42,6 +42,7 @@ import com.facebook.drawee.view.SimpleDraweeView; import com.google.android.material.chip.Chip; import com.nextcloud.talk.R; import com.nextcloud.talk.application.NextcloudTalkApplication; +import com.nextcloud.talk.models.database.CapabilitiesUtil; import com.nextcloud.talk.models.database.UserEntity; import com.nextcloud.talk.models.json.chat.ChatMessage; import com.nextcloud.talk.models.json.conversations.Conversation; @@ -136,20 +137,45 @@ public class ConversationItem extends AbstractFlexibleItem lastVisibleItem) { - if(!newMentionPopupBubble.isShown()){ + if (!newMentionPopupBubble.isShown()){ newMentionPopupBubble.show(); } return; diff --git a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java index bf4f63c2f..dd893b5f7 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/conversations/Conversation.java @@ -98,6 +98,9 @@ public class Conversation { @JsonField(name = "canDeleteConversation") public Boolean canDeleteConversation; + @JsonField(name = "unreadMentionDirect") + public Boolean unreadMentionDirect; + public boolean isPublic() { return (ConversationType.ROOM_PUBLIC_CALL.equals(type)); } @@ -254,6 +257,10 @@ public class Conversation { return this.callFlag; } + public Boolean getUnreadMentionDirect() { + return unreadMentionDirect; + } + public void setRoomId(String roomId) { this.roomId = roomId; } @@ -359,6 +366,10 @@ public class Conversation { this.callFlag = callFlag; } + public void setUnreadMentionDirect(Boolean unreadMentionDirect) { + this.unreadMentionDirect = unreadMentionDirect; + } + @Override public boolean equals(Object o) { if (this == o) {