aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/contact_details
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/contact_details')
-rw-r--r--main/src/ui/contact_details/permissions_provider.vala11
1 files changed, 6 insertions, 5 deletions
diff --git a/main/src/ui/contact_details/permissions_provider.vala b/main/src/ui/contact_details/permissions_provider.vala
index 1a8649a8..1fd460ad 100644
--- a/main/src/ui/contact_details/permissions_provider.vala
+++ b/main/src/ui/contact_details/permissions_provider.vala
@@ -17,12 +17,13 @@ public class PermissionsProvider : Plugins.ContactDetailsProvider, Object {
if (type != Plugins.WidgetType.GTK) return;
Xmpp.Jid? own_jid = stream_interactor.get_module(MucManager.IDENTITY).get_own_jid(conversation.counterpart, conversation.account);
- if (stream_interactor.get_module(MucManager.IDENTITY).get_role(own_jid, conversation.account)==Xmpp.Xep.Muc.Role.VISITOR){
- Button voice_request = new Button() {visible=true, label=_("Request")};
- voice_request.clicked.connect(()=>stream_interactor.get_module(MucManager.IDENTITY).request_voice(conversation.account, conversation.counterpart));
- contact_details.add(_("Permissions"), _("Request permission to send messages"), "", voice_request);
+ if (own_jid == null) return;
- }
+ if (stream_interactor.get_module(MucManager.IDENTITY).get_role(own_jid, conversation.account) == Xmpp.Xep.Muc.Role.VISITOR){
+ Button voice_request = new Button() {visible=true, label=_("Request")};
+ voice_request.clicked.connect(()=>stream_interactor.get_module(MucManager.IDENTITY).request_voice(conversation.account, conversation.counterpart));
+ contact_details.add(_("Permissions"), _("Request permission to send messages"), "", voice_request);
+ }
}
}