handle data forms in groupchat messages. This way room admins can handle voice
requests.
This commit is contained in:
parent
70d2fb435b
commit
2a1f9d2abb
|
@ -1280,6 +1280,8 @@ class GcMessageReceivedEvent(nec.NetworkIncomingEvent):
|
|||
if self.status_code != []:
|
||||
gajim.nec.push_incoming_event(GcConfigChangedReceivedEvent(
|
||||
None, conn=self.conn, msg_event=self))
|
||||
if self.msg_obj.form_node:
|
||||
return True
|
||||
return
|
||||
|
||||
self.displaymarking = None
|
||||
|
|
|
@ -329,6 +329,16 @@ class Interface:
|
|||
if gc_control and gc_control.autorejoin:
|
||||
gc_control.autorejoin = False
|
||||
|
||||
def handle_event_gc_message(self, 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))
|
||||
|
@ -1415,6 +1425,7 @@ class Interface:
|
|||
'fingerprint-error': [self.handle_event_fingerprint_error],
|
||||
'gc-invitation-received': [self.handle_event_gc_invitation],
|
||||
'gc-presence-received': [self.handle_event_gc_presence],
|
||||
'gc-message-received': [self.handle_event_gc_message],
|
||||
'gmail-notify': [self.handle_event_gmail_notify],
|
||||
'gpg-password-required': [self.handle_event_gpg_password_required],
|
||||
'gpg-trust-key': [self.handle_event_gpg_trust_key],
|
||||
|
|
Loading…
Reference in New Issue