comparison src/plugins/plugin_xep_0045.py @ 2148:a543eda2c923

core (memory/disco): getInfos now handle node + use client instead of profile in many methods
author Goffi <goffi@goffi.org>
date Sun, 12 Feb 2017 20:43:20 +0100
parents 33c8c4973743
children a0e6f7951bd7
comparison
equal deleted inserted replaced
2147:bca699faf416 2148:a543eda2c923
360 """Return first found MUC service of an entity 360 """Return first found MUC service of an entity
361 361
362 @param jid_: entity which may have a MUC service, or None for our own server 362 @param jid_: entity which may have a MUC service, or None for our own server
363 @param profile: %(doc_profile)s 363 @param profile: %(doc_profile)s
364 """ 364 """
365 client = self.host.getClient(profile)
365 muc_service = None 366 muc_service = None
366 services = yield self.host.findServiceEntities("conference", "text", jid_, profile=profile) 367 services = yield self.host.findServiceEntities(client, "conference", "text", jid_)
367 for service in services: 368 for service in services:
368 if ".irc." not in service.userhost(): 369 if ".irc." not in service.userhost():
369 # FIXME: 370 # FIXME:
370 # This ugly hack is here to avoid an issue with openfire: the IRC gateway 371 # This ugly hack is here to avoid an issue with openfire: the IRC gateway
371 # use "conference/text" identity (instead of "conference/irc") 372 # use "conference/text" identity (instead of "conference/irc")
710 return False 711 return False
711 except jid.InvalidFormat: 712 except jid.InvalidFormat:
712 msg = D_(u"{} is not a valid JID!".format(unparsed)) 713 msg = D_(u"{} is not a valid JID!".format(unparsed))
713 self.text_cmds.feedBack(client, msg, mess_data) 714 self.text_cmds.feedBack(client, msg, mess_data)
714 return False 715 return False
715 d = self.host.getDiscoItems(service, profile=client.profile) 716 d = self.host.getDiscoItems(client, service)
716 d.addCallback(self._showListUI, client, service) 717 d.addCallback(self._showListUI, client, service)
717 718
718 return False 719 return False
719 720
720 def _whois(self, client, whois_msg, mess_data, target_jid): 721 def _whois(self, client, whois_msg, mess_data, target_jid):