Fix runtime critical

This commit is contained in:
fiaxh 2020-05-28 20:33:28 +02:00
parent 40c66bc584
commit 2f40726f55

View file

@ -17,11 +17,12 @@ 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 (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);
}
}
}