aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-05-28 20:33:28 +0200
committerfiaxh <git@lightrise.org>2020-06-03 21:50:40 +0200
commit2f40726f556b5edf5d0302a293a528943b9a214b (patch)
tree3d82d9b7a002a4c37166bff12702acf6700ff9fe
parent40c66bc58487c39e44c400e137404c6a2bc08155 (diff)
downloaddino-2f40726f556b5edf5d0302a293a528943b9a214b.tar.gz
dino-2f40726f556b5edf5d0302a293a528943b9a214b.zip
Fix runtime critical
-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);
+ }
}
}