diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-11-08 21:49:48 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-11-08 21:49:48 +0100 |
commit | e1b9f562304ba729f3132d8176a2dfcf27e69160 (patch) | |
tree | 04e01a0fe42b0b6cd6ff23e9a89c649781985543 /src/main/java/de/pixart/messenger/ui | |
parent | 0cf9f5eb0f0293c6b3be9147fda3712e4edef89f (diff) |
don't mark previous conversation as read when processing pending intent
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 5e2199206..6275e3016 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -140,6 +140,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; long FirstStartTime = -1; @@ -548,7 +549,7 @@ public class ConversationActivity extends XmppActivity } public void sendReadMarkerIfNecessary(final Conversation conversation) { - if (!mActivityPaused && conversation != null) { + if (!mActivityPaused && !mUnprocessedNewIntent && conversation != null) { xmppConnectionService.sendReadMarker(conversation); } } @@ -1294,6 +1295,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); @@ -1551,6 +1553,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 @@ -1560,7 +1563,9 @@ public class ConversationActivity extends XmppActivity if (message != null) { startDownloadable(message); } - } + } else { + mUnprocessedNewIntent = false; + } } } |