Philipp Hörist pushed to branch master at gajim / python-nbxmpp

Commits:

1 changed file:

Changes:

  • nbxmpp/structs.py
    ... ... @@ -147,6 +147,28 @@ class DiscoInfo(namedtuple('DiscoInfo', 'jid node identities features dataforms'
    147 147
                 except Exception:
    
    148 148
                     continue
    
    149 149
     
    
    150
    +    def supports(self, feature):
    
    151
    +        return feature in self.features
    
    152
    +
    
    153
    +    @property
    
    154
    +    def mam_namespace(self):
    
    155
    +        if NS_MAM_2 in self.features:
    
    156
    +            return NS_MAM_2
    
    157
    +        if NS_MAM_1 in self.features:
    
    158
    +            return NS_MAM_1
    
    159
    +
    
    160
    +    @property
    
    161
    +    def has_mam_2(self):
    
    162
    +        return NS_MAM_2 in self.features
    
    163
    +
    
    164
    +    @property
    
    165
    +    def has_mam_1(self):
    
    166
    +        return NS_MAM_1 in self.features
    
    167
    +
    
    168
    +    @property
    
    169
    +    def has_mam(self):
    
    170
    +        return self.has_mam_1 or self.has_mam_2
    
    171
    +
    
    150 172
         @property
    
    151 173
         def is_muc(self):
    
    152 174
             for identity in self.identities:
    
    ... ... @@ -192,10 +214,6 @@ class DiscoInfo(namedtuple('DiscoInfo', 'jid node identities features dataforms'
    192 214
         def muc_lang(self):
    
    193 215
             return self._get_form_value(NS_MUC_INFO, 'muc#roominfo_lang')
    
    194 216
     
    
    195
    -    @property
    
    196
    -    def muc_has_mam(self):
    
    197
    -        return NS_MAM_2 in self.features or NS_MAM_1 in self.features
    
    198
    -
    
    199 217
         @property
    
    200 218
         def muc_is_persistent(self):
    
    201 219
             return 'muc_persistent' in self.features