Disable ourself in group chat room creation

This commit is contained in:
Sylvain Berfini 2019-01-03 11:18:49 +01:00
parent e931733ebf
commit f00f016423

View file

@ -137,6 +137,15 @@ public class SearchContactsAdapter extends RecyclerView.Adapter<SearchContactVie
&& !searchResult.hasCapability(FriendCapability.LimeX3Dh))) {
// Disable row, contact doesn't have the required capabilities
holder.disabled.setVisibility(View.VISIBLE);
} else if (mSecurityEnabled || !mIsOnlyOnePersonSelection) {
ProxyConfig lpc =
LinphoneManager.getLcIfManagerNotDestroyedOrNull().getDefaultProxyConfig();
if (lpc != null
&& searchResult.getAddress() != null
&& lpc.getIdentityAddress().weakEqual(searchResult.getAddress())) {
// Disable row, we can't use our own address in a group chat room
holder.disabled.setVisibility(View.VISIBLE);
}
}
} else {
ContactAvatar.displayAvatar(holder.name.getText().toString(), holder.avatarLayout);