aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConversationFragment.java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index c92ca19d3..29b034308 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -2078,6 +2078,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (this.activity == null || this.binding == null) {
return false;
}
+
+ if (!activity.xmppConnectionService.isConversationStillOpen(this.conversation)) {
+ activity.onConversationArchived(this.conversation);
+ return false;
+ }
+
stopScrolling();
Log.d(Config.LOGTAG, "reInit(hasExtras=" + Boolean.toString(hasExtras) + ")");
@@ -2344,6 +2350,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
Log.d(Config.LOGTAG, "ConversationFragment.refresh() skipped updated because view binding was null");
return;
}
+ if (this.conversation != null && this.activity != null && this.activity.xmppConnectionService != null) {
+ if (!activity.xmppConnectionService.isConversationStillOpen(this.conversation)) {
+ activity.onConversationArchived(this.conversation);
+ return;
+ }
+ }
this.refresh(true);
}
@@ -2386,10 +2398,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
}
- public void setFocusOnInputField() {
- this.binding.textinput.requestFocus();
- }
-
public void doneSendingPgpMessage() {
mSendingPgpMessage.set(false);
}
@@ -2906,8 +2914,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (uuid != null) {
Conversation conversation = activity.xmppConnectionService.findConversationByUuid(uuid);
if (conversation == null) {
- Log.d(Config.LOGTAG, "unable to restore activity");
clearPending();
+ activity.onConversationArchived(null);
return;
}
reInit(conversation);
@@ -2915,6 +2923,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (scrollState != null) {
setScrollPosition(scrollState);
}
+ } else {
+ if (!activity.xmppConnectionService.isConversationStillOpen(conversation)) {
+ clearPending();
+ activity.onConversationArchived(conversation);
+ return;
+ }
}
ActivityResult activityResult = postponedActivityResult.pop();
if (activityResult != null) {