diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-11-08 12:42:13 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-11-08 12:42:13 +0100 |
commit | 1ef8d0a74633e9236f4d6868650b1af254897284 (patch) | |
tree | dec1b362700acdc94dc9e69792330dfcbef24f79 /src/main/java | |
parent | bca8f11c9c2d3df9dcfc2253bc108fc6e9a241ef (diff) |
don't mark previous conversation as read when processing pending intent. fixes #2079
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index bf9bcd37..b0a778fb 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -120,6 +120,7 @@ public class ConversationActivity extends XmppActivity private boolean mActivityPaused = false; private AtomicBoolean mRedirected = new AtomicBoolean(false); private Pair<Integer, Intent> mPostponedActivityResult; + private boolean mUnprocessedNewIntent = false; public Conversation getSelectedConversation() { return this.mSelectedConversation; @@ -375,7 +376,7 @@ public class ConversationActivity extends XmppActivity } public void sendReadMarkerIfNecessary(final Conversation conversation) { - if (!mActivityPaused && conversation != null) { + if (!mActivityPaused && !mUnprocessedNewIntent && conversation != null) { xmppConnectionService.sendReadMarker(conversation); } } @@ -1087,6 +1088,7 @@ public class ConversationActivity extends XmppActivity protected void onNewIntent(final Intent intent) { if (intent != null && ACTION_VIEW_CONVERSATION.equals(intent.getAction())) { mOpenConversation = null; + mUnprocessedNewIntent = true; if (xmppConnectionServiceBound) { handleViewConversationIntent(intent); intent.setAction(Intent.ACTION_MAIN); @@ -1125,6 +1127,7 @@ public class ConversationActivity extends XmppActivity } this.mActivityPaused = false; + if (!isConversationsOverviewVisable() || !isConversationsOverviewHideable()) { sendReadMarkerIfNecessary(getSelectedConversation()); } @@ -1289,6 +1292,7 @@ public class ConversationActivity extends XmppActivity this.mConversationFragment.appendText(text); } hideConversationsOverview(); + mUnprocessedNewIntent = false; openConversation(); if (mContentView instanceof SlidingPaneLayout) { updateActionBarTitle(true); //fixes bug where slp isn't properly closed yet @@ -1299,6 +1303,8 @@ public class ConversationActivity extends XmppActivity startDownloadable(message); } } + } else { + mUnprocessedNewIntent = false; } } |