Changeset 8622 for branches/gajim_0.11.1/src/common
- Timestamp:
- 08/30/07 02:00:58 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11.1/src/common/zeroconf/connection_zeroconf.py
r7501 r8622 332 332 user_nick = None): 333 333 fjid = jid 334 334 335 335 if not self.connection: 336 336 return 337 337 if not msg and chatstate is None: 338 338 return 339 339 340 340 if self.status in ('invisible', 'offline'): 341 341 self.dispatch('MSGERROR', [unicode(jid), '-1', _('You are not connected or not visible to others. Your message could not be sent.'), None, None]) … … 345 345 msgenc = '' 346 346 if keyID and USE_GPG: 347 # encrypt348 msgenc = self.gpg.encrypt(msg, [keyID])349 if msgenc :347 # encrypt 348 msgenc, error = self.gpg.encrypt(msg, [keyID]) 349 if msgenc and not error: 350 350 msgtxt = '[This message is encrypted]' 351 351 lang = os.getenv('LANG') … … 353 353 msgtxt = _('[This message is encrypted]') +\ 354 354 ' ([This message is encrypted])' # one in locale and one en 355 356 355 else: 356 # Encryption failed, do not send message 357 tim = time.localtime() 358 self.dispatch('MSGNOTSENT', (jid, error, msgtxt, tim)) 359 return 3 360 357 361 if type == 'chat': 358 362 msg_iq = common.xmpp.Message(to = fjid, body = msgtxt, typ = type) 359 363 360 364 else: 361 365 if subject: … … 368 372 if msgenc: 369 373 msg_iq.setTag(common.xmpp.NS_ENCRYPTED + ' x').setData(msgenc) 370 374 371 375 # chatstates - if peer supports jep85 or jep22, send chatstates 372 376 # please note that the only valid tag inside a message containing a <body> … … 386 390 if chatstate is 'composing' or msgtxt: 387 391 chatstate_node.addChild(name = 'composing') 388 392 389 393 if not self.connection.send(msg_iq, msg != None): 390 394 return
