From e1b9f562304ba729f3132d8176a2dfcf27e69160 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 8 Nov 2016 21:49:48 +0100 Subject: don't mark previous conversation as read when processing pending intent --- src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/java') 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 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; + } } } -- cgit v1.2.3