Mercurial > libervia-backend
comparison sat/plugins/plugin_xep_0115.py @ 2830:770ec685ff1f
core (disco): added missing disco extensions when generating the cap hash.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 01 Mar 2019 19:28:11 +0100 |
parents | 003b8b4b56a7 |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2829:649cb3fd7711 | 2830:770ec685ff1f |
---|---|
163 return | 163 return |
164 | 164 |
165 if c_hash != "sha-1": # unknown hash method | 165 if c_hash != "sha-1": # unknown hash method |
166 log.warning( | 166 log.warning( |
167 _( | 167 _( |
168 u"Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)" | 168 u"Unknown hash method for entity capabilities: [{hash_method}] " |
169 u"(entity: {entity_jid}, node: {node})" | |
169 ) | 170 ) |
170 % {"hash_method": c_hash, "jid": from_jid, "node": c_node} | 171 .format(hash_method = c_hash, entity_jid = from_jid, node = c_node) |
171 ) | 172 ) |
172 | 173 |
173 def cb(__): | 174 def cb(__): |
174 computed_hash = self.host.memory.getEntityDatum( | 175 computed_hash = self.host.memory.getEntityDatum( |
175 from_jid, C.ENTITY_CAP_HASH, self.profile | 176 from_jid, C.ENTITY_CAP_HASH, self.profile |
176 ) | 177 ) |
177 if computed_hash != c_ver: | 178 if computed_hash != c_ver: |
178 log.warning( | 179 log.warning( |
179 _( | 180 _( |
180 u"Computed hash differ from given hash:\ngiven: [%(given_hash)s]\ncomputed: [%(computed_hash)s]\n(entity: %(jid)s, node: %(node)s)" | 181 u"Computed hash differ from given hash:\n" |
182 u"given: [{given}]\n" | |
183 u"computed: [{computed}]\n" | |
184 u"(entity: {entity_jid}, node: {node})" | |
185 ).format( | |
186 given = c_ver, | |
187 computed = computed_hash, | |
188 entity_jid = from_jid, | |
189 node = c_node, | |
181 ) | 190 ) |
182 % { | |
183 "given_hash": c_ver, | |
184 "computed_hash": computed_hash, | |
185 "jid": from_jid, | |
186 "node": c_node, | |
187 } | |
188 ) | 191 ) |
189 | 192 |
190 def eb(failure): | 193 def eb(failure): |
191 if isinstance(failure.value, error.ConnectionDone): | 194 if isinstance(failure.value, error.ConnectionDone): |
192 return | 195 return |