aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-01 23:22:44 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-01 23:22:44 +0200
commit554266bbf63551547c82ada832469eddd59a356e (patch)
treea0702342973e7b3cfd611703736130c7ea2b31e4 /src/main/java/de/pixart
parent20d6f2cc5c96627920a645d72d6dc0bd8bcb7029 (diff)
fix context menu in ConferenceDetailsActivity
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java15
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));
}
}