diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 2eb6a811e791179bad006d11d20dbca2833e7633..dc73c23fefa4b7fce79a7eed013a66788262795f 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2431,6 +2431,8 @@ public class XmppConnectionService extends Service { } private void archiveConversation(Conversation conversation, final boolean maySynchronizeWithBookmarks) { + if (isOnboarding()) return; + getNotificationService().clear(conversation); conversation.setStatus(Conversation.STATUS_ARCHIVED); conversation.setNextMessage(null); diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java index c3f62f8242477b0f042bfcd0590018bb3ce9f901..f42325e87867420067a536848c12e0f406b04e35 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationsOverviewFragment.java @@ -205,7 +205,7 @@ public class ConversationsOverviewFragment extends XmppFragment { } }; - private ItemTouchHelper touchHelper; + private ItemTouchHelper touchHelper = null; public static Conversation getSuggestion(Activity activity) { final Conversation exception; @@ -305,8 +305,6 @@ public class ConversationsOverviewFragment extends XmppFragment { this.binding.list.setAdapter(this.conversationsAdapter); this.binding.list.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false)); registerForContextMenu(this.binding.list); - this.touchHelper = new ItemTouchHelper(this.callback); - this.touchHelper.attachToRecyclerView(this.binding.list); return binding.getRoot(); } @@ -387,6 +385,10 @@ public class ConversationsOverviewFragment extends XmppFragment { @Override public void onBackendConnected() { + if (this.touchHelper == null && (activity.xmppConnectionService == null || !activity.xmppConnectionService.isOnboarding())) { + this.touchHelper = new ItemTouchHelper(this.callback); + this.touchHelper.attachToRecyclerView(this.binding.list); + } refresh(); }