error messages are nowprinted as if they come from server

This commit is contained in:
Yann Leboulanger 2005-09-15 17:33:02 +00:00
parent 4d4434c951
commit 973631a2c9
3 changed files with 14 additions and 5 deletions

View File

@ -474,7 +474,8 @@ class Interface:
if jid.find('@') <= 0:
jid = jid.replace('@', '')
self.roster.on_message(jid, _('error while sending') + \
' \"%s\" ( %s )' % (array[3], array[2]), array[4], account)
' \"%s\" ( %s )' % (array[3], array[2]), array[4], account, \
msg_type='error')
def handle_event_msgsent(self, account, array):
#('MSGSENT', account, (jid, msg, keyID))

View File

@ -1498,14 +1498,17 @@ _('If "%s" accepts this request you will know his status.') %jid)
if qs.has_key(jid):
no_queue = False
if self.plugin.windows[account]['chats'].has_key(jid):
typ = ''
if msg_type == 'error':
typ = 'status'
self.plugin.windows[account]['chats'][jid].print_conversation(msg,
jid, tim = tim, encrypted = encrypted, subject = subject)
jid, typ, tim = tim, encrypted = encrypted, subject = subject)
return
#We save it in a queue
if no_queue:
qs[jid] = []
qs[jid].append((msg, tim, encrypted))
qs[jid].append((msg, msg_type, tim, encrypted))
self.nb_unread += 1
if (not autopopup or ( not autopopupaway and \
gajim.connections[account].connected > 2)) and not \

View File

@ -700,8 +700,13 @@ timestamp, contact):
l = gajim.awaiting_messages[self.account][jid]
user = self.contacts[jid]
for event in l:
self.print_conversation(event[0], jid, tim = event[1],
encrypted = event[2], contact='print_queue')
ev1 = event[1]
if ev1 != 'error':
ev1 = 'print_queue'
else:
ev1 = 'status'
self.print_conversation(event[0], jid, ev1,
tim = event[2], encrypted = event[3])
self.plugin.roster.nb_unread -= 1
self.plugin.roster.show_title()
del gajim.awaiting_messages[self.account][jid]