Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #220 from dinsic-pim/dinsic-sp5bug-doubleopencontact
Browse files Browse the repository at this point in the history
correct a bug that  open a direct tchat twice
  • Loading branch information
giomfo authored Jun 20, 2018
2 parents dea3340 + 77661f3 commit be1b21a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be1b21a

Please sign in to comment.