diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-04-01 23:22:44 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-04-01 23:22:44 +0200 |
commit | 554266bbf63551547c82ada832469eddd59a356e (patch) | |
tree | a0702342973e7b3cfd611703736130c7ea2b31e4 /src/main/java | |
parent | 20d6f2cc5c96627920a645d72d6dc0bd8bcb7029 (diff) |
fix context menu in ConferenceDetailsActivity
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 66c64a719..056d63d9c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -433,9 +433,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers name = user.getName(); } menu.setHeaderTitle(name); + MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); + MenuItem highlightInMuc = menu.findItem(R.id.highlight_in_muc); if (user.getRealJid() != null) { - MenuItem highlightInMuc = menu.findItem(R.id.highlight_in_muc); - MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); MenuItem startConversation = menu.findItem(R.id.start_conversation); MenuItem giveMembership = menu.findItem(R.id.give_membership); MenuItem removeMembership = menu.findItem(R.id.remove_membership); @@ -444,7 +444,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room); MenuItem banFromConference = menu.findItem(R.id.ban_from_conference); MenuItem invite = menu.findItem(R.id.invite); - highlightInMuc.setVisible(true); startConversation.setVisible(true); if (user.getRole() == MucOptions.Role.NONE) { invite.setVisible(true); @@ -475,8 +474,14 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers banFromConference.setVisible(true); } } else { - MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); - sendPrivateMessage.setVisible(user.getRole().ranks(MucOptions.Role.PARTICIPANT)); + if (jid != null && !jid.isBareJid()) { + if (mConversation.getMucOptions().isUserInRoom(jid)) { + sendPrivateMessage.setVisible(true); + } else { + sendPrivateMessage.setVisible(false); + } + } + highlightInMuc.setVisible(self.getRole().ranks(MucOptions.Role.PARTICIPANT)); } } |