add some if connection:
This commit is contained in:
parent
1149556e4b
commit
28b9a37333
|
@ -819,7 +819,8 @@ class Connection:
|
||||||
if signed:
|
if signed:
|
||||||
p.setTag(common.xmpp.NS_SIGNED + ' x').setData(signed)
|
p.setTag(common.xmpp.NS_SIGNED + ' x').setData(signed)
|
||||||
|
|
||||||
self.connection.send(p)
|
if self.connection:
|
||||||
|
self.connection.send(p)
|
||||||
self.dispatch('STATUS', show)
|
self.dispatch('STATUS', show)
|
||||||
#ask our VCard
|
#ask our VCard
|
||||||
iq = self.request_vcard(None)
|
iq = self.request_vcard(None)
|
||||||
|
@ -835,7 +836,8 @@ class Connection:
|
||||||
p = common.xmpp.Presence(typ = 'unavailable')
|
p = common.xmpp.Presence(typ = 'unavailable')
|
||||||
if msg:
|
if msg:
|
||||||
p.setStatus(msg)
|
p.setStatus(msg)
|
||||||
self.connection.send(p)
|
if self.connection:
|
||||||
|
self.connection.send(p)
|
||||||
try:
|
try:
|
||||||
self.connection.disconnect()
|
self.connection.disconnect()
|
||||||
except:
|
except:
|
||||||
|
@ -853,7 +855,8 @@ class Connection:
|
||||||
p.setStatus(msg)
|
p.setStatus(msg)
|
||||||
if signed:
|
if signed:
|
||||||
p.setTag(common.xmpp.NS_SIGNED + ' x').setData(signed)
|
p.setTag(common.xmpp.NS_SIGNED + ' x').setData(signed)
|
||||||
self.connection.send(p)
|
if connection:
|
||||||
|
self.connection.send(p)
|
||||||
self.dispatch('STATUS', show)
|
self.dispatch('STATUS', show)
|
||||||
|
|
||||||
def send_message(self, jid, msg, keyID, type = 'chat', subject=''):
|
def send_message(self, jid, msg, keyID, type = 'chat', subject=''):
|
||||||
|
|
Loading…
Reference in New Issue