Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0045.py @ 1552:e0bde0d0b321
core (disco): use of “profile” instead of “profile_key” in several disco methods
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 02 Nov 2015 22:02:41 +0100 |
parents | 55967cf161b1 |
children | 0502a1fbe8b5 |
comparison
equal
deleted
inserted
replaced
1551:591c32dbfb0b | 1552:e0bde0d0b321 |
---|---|
98 | 98 |
99 def profileConnected(self, profile): | 99 def profileConnected(self, profile): |
100 def assign_service(service): | 100 def assign_service(service): |
101 client = self.host.getClient(profile) | 101 client = self.host.getClient(profile) |
102 client.muc_service = service | 102 client.muc_service = service |
103 return self.getMUCService(profile_key=profile).addCallback(assign_service) | 103 return self.getMUCService(profile=profile).addCallback(assign_service) |
104 | 104 |
105 def checkClient(self, profile): | 105 def checkClient(self, profile): |
106 """Check if the profile is connected and has used the MUC feature. | 106 """Check if the profile is connected and has used the MUC feature. |
107 | 107 |
108 If profile was using MUC feature but is now disconnected, remove it from the client list. | 108 If profile was using MUC feature but is now disconnected, remove it from the client list. |
302 if not self.checkClient(profile): | 302 if not self.checkClient(profile): |
303 return [] | 303 return [] |
304 return self.clients[profile].rec_subjects.values() | 304 return self.clients[profile].rec_subjects.values() |
305 | 305 |
306 @defer.inlineCallbacks | 306 @defer.inlineCallbacks |
307 def getMUCService(self, jid_=None, profile_key=C.PROF_KEY_NONE): | 307 def getMUCService(self, jid_=None, profile=C.PROF_KEY_NONE): |
308 """Return first found MUC service of an entity | 308 """Return first found MUC service of an entity |
309 | 309 |
310 @param jid_: entity which may have a MUC service, or None for our own server | 310 @param jid_: entity which may have a MUC service, or None for our own server |
311 @param profile_key: %(doc_profile_key)s | 311 @param profile: %(doc_profile)s |
312 """ | 312 """ |
313 muc_service = None | 313 muc_service = None |
314 services = yield self.host.findServiceEntities("conference", "text", jid_, profile_key=profile_key) | 314 services = yield self.host.findServiceEntities("conference", "text", jid_, profile=profile) |
315 for service in services: | 315 for service in services: |
316 if ".irc." not in service.userhost(): | 316 if ".irc." not in service.userhost(): |
317 # FIXME: | 317 # FIXME: |
318 # This ugly hack is here to avoid an issue with openfire: the IRC gateway | 318 # This ugly hack is here to avoid an issue with openfire: the IRC gateway |
319 # use "conference/text" identity (instead of "conference/irc") | 319 # use "conference/text" identity (instead of "conference/irc") |