diff --git a/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java b/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java index 00503366587..dc1e4339668 100644 --- a/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java +++ b/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java @@ -480,11 +480,8 @@ public static void startDirectChat(final RiotAppCompatActivity activity, final M // Tell if contact is tchap user if (MXSession.isUserId(selectedContact.mUserId)) { // || DinsicUtils.isFromFrenchGov(item.mContact.getEmails())) - // The contact is a Tchap user - if (DinsicUtils.openDirectChat(activity, selectedContact.mUserId, session, false)) { - // If a direct chat already exist with him, open it - DinsicUtils.openDirectChat(activity, selectedContact.mUserId, session, true); - } else { + // The contact is a Tchap user, try to open an existing direct chat + if (!DinsicUtils.openDirectChat(activity, selectedContact.mUserId, session, false)) { // If it's a Tchap user without a direct chat with him // Display a popup to confirm the creation of a new direct chat with him String msg = activity.getResources().getString(R.string.start_new_chat_prompt_msg, selectedContact.mDisplayName);