Commit 22ddb4b8 authored by Philipp Hörist's avatar Philipp Hörist

Add forms message attribute

parent 91c6dd86
Pipeline #4377 passed with stages
in 27 seconds
......@@ -18,6 +18,7 @@
import logging
from nbxmpp.protocol import NodeProcessed
from nbxmpp.protocol import NS_DATA
from nbxmpp.structs import StanzaHandler
from nbxmpp.structs import StanzaIDData
from nbxmpp.util import error_factory
......@@ -75,6 +76,9 @@ class BaseMessage:
properties.body = stanza.getBody()
properties.thread = stanza.getThread()
properties.subject = stanza.getSubject()
forms = stanza.getTags('x', namespace=NS_DATA)
if forms:
properties.forms = forms
@staticmethod
def _parse_type(stanza):
......
......@@ -552,6 +552,7 @@ class MessageProperties:
self.oob = None
self.correction = None
self.attention = False
self.forms = None
@property
def has_user_delay(self):
......@@ -644,6 +645,10 @@ class MessageProperties:
def has_attention(self):
return self.attention
@property
def has_forms(self):
return self.forms is not None
class IqProperties:
def __init__(self):
......
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