bugfixes in the last jabber.py
This commit is contained in:
parent
15efcf97da
commit
6739e0b190
1 changed files with 3 additions and 2 deletions
|
@ -260,7 +260,7 @@ class Connection(xmlstream.Client):
|
||||||
"""Called internally when a 'protocol element' is received.
|
"""Called internally when a 'protocol element' is received.
|
||||||
Builds the relevant jabber.py object and dispatches it
|
Builds the relevant jabber.py object and dispatches it
|
||||||
to a relevant function or callback."""
|
to a relevant function or callback."""
|
||||||
self.lastIncome = time.time()
|
self._lastIncome = time.time()
|
||||||
name=stanza.getName()
|
name=stanza.getName()
|
||||||
if not self.handlers.has_key(name):
|
if not self.handlers.has_key(name):
|
||||||
self.DEBUG("whats a tag -> " + name,DBG_NODE_UNKNOWN)
|
self.DEBUG("whats a tag -> " + name,DBG_NODE_UNKNOWN)
|
||||||
|
@ -281,6 +281,7 @@ class Connection(xmlstream.Client):
|
||||||
typns=typ+ns
|
typns=typ+ns
|
||||||
if not self.handlers[name].has_key(ns): ns=''
|
if not self.handlers[name].has_key(ns): ns=''
|
||||||
if not self.handlers[name].has_key(typ): typ=''
|
if not self.handlers[name].has_key(typ): typ=''
|
||||||
|
if not self.handlers[name].has_key(typns): typns=''
|
||||||
if typ and ns and not self.handlers[name].has_key(typns): typns=''
|
if typ and ns and not self.handlers[name].has_key(typns): typns=''
|
||||||
|
|
||||||
chain=[]
|
chain=[]
|
||||||
|
@ -412,7 +413,7 @@ class Connection(xmlstream.Client):
|
||||||
return ustr(self._id)
|
return ustr(self._id)
|
||||||
|
|
||||||
def process(self, timeout=0):
|
def process(self, timeout=0):
|
||||||
if time.time() > self._lastIncome + timeout:
|
if time.time() > self._lastIncome + 300:
|
||||||
self._lastIncome = time.time()
|
self._lastIncome = time.time()
|
||||||
iq = Iq(type="get", to=self._host, query=NS_LAST)
|
iq = Iq(type="get", to=self._host, query=NS_LAST)
|
||||||
print "iq", iq
|
print "iq", iq
|
||||||
|
|
Loading…
Add table
Reference in a new issue