mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 08:55:54 +03:00
also account for unread 1on1 messages for unreadMessages bubbleClicked
Fixes #1599 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1342bd5df3
commit
638b7c8288
1 changed files with 7 additions and 4 deletions
|
@ -626,20 +626,23 @@ public class ConversationsListController extends BaseController implements Searc
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkToShowUnreadBubble() {
|
private void checkToShowUnreadBubble() {
|
||||||
try{
|
try {
|
||||||
int lastVisibleItem = layoutManager.findLastCompletelyVisibleItemPosition();
|
int lastVisibleItem = layoutManager.findLastCompletelyVisibleItemPosition();
|
||||||
for (AbstractFlexibleItem flexItem : callItems) {
|
for (AbstractFlexibleItem flexItem : callItems) {
|
||||||
Conversation conversationItem = ((ConversationItem) flexItem).getModel();
|
Conversation conversationItem = ((ConversationItem) flexItem).getModel();
|
||||||
int position = adapter.getGlobalPositionOf(flexItem);
|
int position = adapter.getGlobalPositionOf(flexItem);
|
||||||
if (conversationItem.unreadMention && position > lastVisibleItem) {
|
if ((conversationItem.unreadMention ||
|
||||||
if (!newMentionPopupBubble.isShown()){
|
(conversationItem.unreadMessages > 0 &&
|
||||||
|
conversationItem.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) &&
|
||||||
|
position > lastVisibleItem) {
|
||||||
|
if (!newMentionPopupBubble.isShown()) {
|
||||||
newMentionPopupBubble.show();
|
newMentionPopupBubble.show();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newMentionPopupBubble.hide();
|
newMentionPopupBubble.hide();
|
||||||
} catch (NullPointerException e){
|
} catch (NullPointerException e) {
|
||||||
Log.d(TAG, "A NPE was caught when trying to show the unread popup bubble. This might happen when the " +
|
Log.d(TAG, "A NPE was caught when trying to show the unread popup bubble. This might happen when the " +
|
||||||
"user already left the conversations-list screen so the popup bubble is not available anymore.", e);
|
"user already left the conversations-list screen so the popup bubble is not available anymore.", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue