don't send termination unless we've sent a message

fixes #3963
This commit is contained in:
Brendan Taylor 2008-05-26 23:53:40 +00:00
parent dbcfc984f5
commit e09c93621e
1 changed files with 4 additions and 2 deletions

View File

@ -111,8 +111,10 @@ class StanzaSession(object):
self.negotiated = {}
def terminate(self):
# only send termination message if we think they might have XEP-0201 support
if self.received_thread_id or self.last_receive == 0:
# only send termination message if we've sent a message and think they
# have XEP-0201 support
if self.last_send > 0 and \
(self.received_thread_id or self.last_receive == 0):
msg = xmpp.Message()
feature = msg.NT.feature
feature.setNamespace(xmpp.NS_FEATURE)