From 4b88f7b845d91b57c0bbe86ae57e9cda157dbe01 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Sat, 1 Dec 2018 10:38:57 -0800 Subject: [PATCH] Unsubscribe from typing observers when forwarding messages. --- .../securesms/ConversationFragment.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ConversationFragment.java b/src/org/thoughtcrime/securesms/ConversationFragment.java index 31ea9b05a3..7ac39f48d7 100644 --- a/src/org/thoughtcrime/securesms/ConversationFragment.java +++ b/src/org/thoughtcrime/securesms/ConversationFragment.java @@ -176,6 +176,12 @@ public class ConversationFragment extends Fragment this.listener = (ConversationFragmentListener)activity; } + @Override + public void onStart() { + super.onStart(); + initializeTypingObserver(); + } + @Override public void onResume() { super.onResume(); @@ -185,6 +191,12 @@ public class ConversationFragment extends Fragment } } + @Override + public void onStop() { + super.onStop(); + ApplicationContext.getInstance(requireContext()).getTypingStatusRepository().getTypists(threadId).removeObservers(this); + } + public void onNewIntent() { if (actionMode != null) { actionMode.finish(); @@ -227,7 +239,6 @@ public class ConversationFragment extends Fragment OnScrollListener scrollListener = new ConversationScrollListener(getActivity()); list.addOnScrollListener(scrollListener); - initializeTypingObserver(); } private void initializeListAdapter() {