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

correct a bug that open a direct tchat twice #220

Merged
merged 2 commits into from
Jun 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -445,11 +445,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