From fe2129849d646b6fcbaab0a8d55a8fd9e117a435 Mon Sep 17 00:00:00 2001 From: jp-modernisation-gouv-fr Date: Sun, 17 Jun 2018 21:14:55 +0000 Subject: [PATCH] correct double open tchat --- vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 ac6b697f22b..f907680e7c4 100644 --- a/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java +++ b/vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java @@ -446,10 +446,11 @@ 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 { + if (!DinsicUtils.openDirectChat(activity, selectedContact.mUserId, session, false)) { + //to be consciensously reviewed! + // // If a direct chat already exist with him, open it + // DinsicUtils.openDirectChat(activity, selectedContact.mUserId, session, true); + // } else { // 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);