Commit 631740b6 authored by Philipp Hörist's avatar Philipp Hörist

MUC: Fix voice request

Fixes #9159
parent c5f8fe91
......@@ -1748,7 +1748,14 @@ class GcMessageReceivedEvent(nec.NetworkIncomingEvent):
app.nec.push_incoming_event(GcConfigChangedReceivedEvent(
None, conn=self.conn, msg_event=self))
if self.msg_obj.form_node:
return True
# It could be a voice request. See
# http://www.xmpp.org/extensions/xep-0045.html#voiceapprove
from gajim.dialogs import SingleMessageWindow
SingleMessageWindow(
self.conn.name, self.fjid,
action='receive', from_whom=self.fjid,
subject='', message='', resource='', session=None,
form_node=self.msg_obj.form_node)
return
self.displaymarking = None
......
......@@ -3106,6 +3106,7 @@ class SingleMessageWindow:
get_parent()
if form_node:
dataform = dataforms.ExtendForm(node=form_node)
dataform.type_ = 'submit'
self.form_widget = dataforms_widget.DataFormWidget(dataform)
self.form_widget.show_all()
parent_box.add(self.form_widget)
......
......@@ -369,17 +369,6 @@ class Interface:
if gc_control and gc_control.autorejoin:
gc_control.autorejoin = False
@staticmethod
def handle_event_gc_message(obj):
if not obj.stanza.getTag('body'): # no <body>
# It could be a voice request. See
# http://www.xmpp.org/extensions/xep-0045.html#voiceapprove
if obj.msg_obj.form_node:
dialogs.SingleMessageWindow(obj.conn.name, obj.fjid,
action='receive', from_whom=obj.fjid,
subject='', message='', resource='', session=None,
form_node=obj.msg_obj.form_node)
def handle_event_presence(self, obj):
# 'NOTIFY' (account, (jid, status, status message, resource,
# priority, # keyID, timestamp, contact_nickname))
......@@ -1532,7 +1521,6 @@ class Interface:
'gc-invitation-received': [self.handle_event_gc_invitation],
'gc-decline-received': [self.handle_event_gc_decline],
'gc-presence-received': [self.handle_event_gc_presence],
'gc-message-received': [self.handle_event_gc_message],
'gpg-password-required': [self.handle_event_gpg_password_required],
'gpg-trust-key': [self.handle_event_gpg_trust_key],
'http-auth-received': [self.handle_event_http_auth],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment