use of de.pixart.messenger.entities.Blockable in project Pix-Art-Messenger by kriztan.
the class ConversationFragment method showBlockSubmenu.
private boolean showBlockSubmenu(View view) {
final Jid jid = conversation.getJid();
if (jid.isDomainJid()) {
BlockContactDialog.show(activity, conversation);
} else {
PopupMenu popupMenu = new PopupMenu(getActivity(), view);
popupMenu.inflate(R.menu.block);
popupMenu.setOnMenuItemClickListener(menuItem -> {
Blockable blockable;
switch(menuItem.getItemId()) {
case R.id.block_domain:
blockable = conversation.getAccount().getRoster().getContact(jid.toDomainJid());
break;
default:
blockable = conversation;
}
BlockContactDialog.show(activity, blockable);
return true;
});
popupMenu.show();
}
return true;
}