comparison src/plugins/plugin_misc_ip.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 8b37a62336c3
comparison
equal deleted inserted replaced
2147:bca699faf416 2148:a543eda2c923
252 @return (deferred): external IP address or None if it can't be discovered 252 @return (deferred): external IP address or None if it can't be discovered
253 """ 253 """
254 if self._external_ip_cache is not None: 254 if self._external_ip_cache is not None:
255 defer.returnValue(self._external_ip_cache) 255 defer.returnValue(self._external_ip_cache)
256 256
257 client = self.host.getClient(profile)
258
257 # we first try with XEP-0279 259 # we first try with XEP-0279
258 ip_check = yield self.host.hasFeature(NS_IP_CHECK, profile=profile) 260 ip_check = yield self.host.hasFeature(client, NS_IP_CHECK)
259 if ip_check: 261 if ip_check:
260 log.debug(u"Server IP Check available, we use it to retrieve our IP") 262 log.debug(u"Server IP Check available, we use it to retrieve our IP")
261 client = self.host.getClient(profile) 263 client = self.host.getClient(profile)
262 iq_elt = client.IQ("get") 264 iq_elt = client.IQ("get")
263 iq_elt.addElement((NS_IP_CHECK, 'address')) 265 iq_elt.addElement((NS_IP_CHECK, 'address'))