Commit 36d685a8 authored by lovetox's avatar lovetox
Browse files

DiscoInfo: Add muc_name property

parent d2d5a377
Loading
Loading
Loading
Loading
+11 −0
Changes for nbxmpp/structs.py: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -199,6 +199,17 @@ class DiscoInfo(namedtuple('DiscoInfo', 'stanza identities features dataforms ti
                    return True
        return False

    @property
    def muc_name(self):
        if self.muc_room_name:
            return self.muc_room_name

        if self.muc_identity_name:
            return self.muc_identity_name

        if self.jid is not None:
            return self.jid.getNode()

    @property
    def muc_identity_name(self):
        for identity in self.identities: