mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 17:52:17 -05:00
hide block contact from context menu when server feature is not available fixed #1207
This commit is contained in:
parent
a0575c81ab
commit
bb60364488
@ -65,6 +65,7 @@ import eu.siacs.conversations.ui.adapter.KnownHostsAdapter;
|
||||
import eu.siacs.conversations.ui.adapter.ListItemAdapter;
|
||||
import eu.siacs.conversations.utils.XmppUri;
|
||||
import eu.siacs.conversations.xmpp.OnUpdateBlocklist;
|
||||
import eu.siacs.conversations.xmpp.XmppConnection;
|
||||
import eu.siacs.conversations.xmpp.jid.InvalidJidException;
|
||||
import eu.siacs.conversations.xmpp.jid.Jid;
|
||||
|
||||
@ -757,14 +758,16 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
|
||||
} else {
|
||||
activity.contact_context_id = acmi.position;
|
||||
final Blockable contact = (Contact) activity.contacts.get(acmi.position);
|
||||
|
||||
final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock);
|
||||
if (blockUnblockItem != null) {
|
||||
XmppConnection xmpp = contact.getAccount().getXmppConnection();
|
||||
if (xmpp != null && xmpp.getFeatures().blocking()) {
|
||||
if (contact.isBlocked()) {
|
||||
blockUnblockItem.setTitle(R.string.unblock_contact);
|
||||
} else {
|
||||
blockUnblockItem.setTitle(R.string.block_contact);
|
||||
}
|
||||
} else {
|
||||
blockUnblockItem.setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user