Commit de0a912a authored by Philipp Hörist's avatar Philipp Hörist

DiscoInfo: Add property is_muc

parent 90d5e6da
......@@ -23,6 +23,7 @@ from nbxmpp.protocol import JID
from nbxmpp.protocol import NS_STANZAS
from nbxmpp.protocol import NS_MAM_1
from nbxmpp.protocol import NS_MAM_2
from nbxmpp.protocol import NS_MUC
from nbxmpp.const import MessageType
from nbxmpp.const import AvatarState
from nbxmpp.const import StatusCode
......@@ -131,6 +132,15 @@ class DiscoInfo(namedtuple('DiscoInfo', 'jid node identities features dataforms'
except Exception:
return None
@property
def is_muc(self):
for identity in self.identities:
if identity.category == 'conference':
if NS_MUC in self.features:
return True
return False
class DiscoIdentity(namedtuple('DiscoIdentity', 'category type name lang')):
......
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