handle correctly pm messages.
This commit is contained in:
parent
30fb604642
commit
c2ece68e43
|
@ -639,8 +639,14 @@ class ChatControlBase(MessageControl):
|
||||||
self.parent_win.redraw_tab(self)
|
self.parent_win.redraw_tab(self)
|
||||||
self.parent_win.show_title()
|
self.parent_win.show_title()
|
||||||
# redraw roster
|
# redraw roster
|
||||||
gajim.interface.roster.draw_contact(jid, self.account)
|
if self.type_id == message_control.TYPE_PM:
|
||||||
gajim.interface.roster.show_title()
|
room_jid, nick = gajim.get_room_and_nick_from_fjid(jid)
|
||||||
|
groupchat_control = gajim.interface.msg_win_mgr.get_control(
|
||||||
|
room_jid, self.account)
|
||||||
|
groupchat_control.draw_contact(nick)
|
||||||
|
else:
|
||||||
|
gajim.interface.roster.draw_contact(jid, self.account)
|
||||||
|
gajim.interface.roster.show_title()
|
||||||
self.msg_textview.grab_focus()
|
self.msg_textview.grab_focus()
|
||||||
# Note, we send None chatstate to preserve current
|
# Note, we send None chatstate to preserve current
|
||||||
self.parent_win.redraw_tab(self)
|
self.parent_win.redraw_tab(self)
|
||||||
|
@ -1631,7 +1637,8 @@ class ChatControl(ChatControlBase):
|
||||||
# list of message ids which should be marked as read
|
# list of message ids which should be marked as read
|
||||||
message_ids = []
|
message_ids = []
|
||||||
for event in events:
|
for event in events:
|
||||||
if event.type_ != 'chat':
|
print event.type_
|
||||||
|
if event.type_ != self.type_id:
|
||||||
continue
|
continue
|
||||||
data = event.parameters
|
data = event.parameters
|
||||||
kind = data[2]
|
kind = data[2]
|
||||||
|
@ -1646,7 +1653,7 @@ class ChatControl(ChatControlBase):
|
||||||
if message_ids:
|
if message_ids:
|
||||||
gajim.logger.set_read_messages(message_ids)
|
gajim.logger.set_read_messages(message_ids)
|
||||||
gajim.events.remove_events(self.account, jid_with_resource,
|
gajim.events.remove_events(self.account, jid_with_resource,
|
||||||
types = ['chat'])
|
types = [self.type_id])
|
||||||
|
|
||||||
self.parent_win.show_title()
|
self.parent_win.show_title()
|
||||||
self.parent_win.redraw_tab(self)
|
self.parent_win.redraw_tab(self)
|
||||||
|
@ -1659,7 +1666,13 @@ class ChatControl(ChatControlBase):
|
||||||
control.update_ui()
|
control.update_ui()
|
||||||
typ = 'pm'
|
typ = 'pm'
|
||||||
|
|
||||||
gajim.interface.roster.draw_contact(jid, self.account)
|
if is_pm:
|
||||||
|
room_jid, nick = gajim.get_room_and_nick_from_fjid(jid)
|
||||||
|
groupchat_control = gajim.interface.msg_win_mgr.get_control(
|
||||||
|
room_jid, self.account)
|
||||||
|
groupchat_control.draw_contact(nick)
|
||||||
|
else:
|
||||||
|
gajim.interface.roster.draw_contact(jid, self.account)
|
||||||
# Redraw parent too
|
# Redraw parent too
|
||||||
gajim.interface.roster.draw_parent_contact(jid, self.account)
|
gajim.interface.roster.draw_parent_contact(jid, self.account)
|
||||||
if (self.contact.show == 'offline' or self.contact.show == 'error'):
|
if (self.contact.show == 'offline' or self.contact.show == 'error'):
|
||||||
|
|
|
@ -2395,7 +2395,10 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
|
|
||||||
mw.new_tab(chat_control)
|
mw.new_tab(chat_control)
|
||||||
|
|
||||||
|
print gajim.events._events
|
||||||
|
print fjid
|
||||||
if len(gajim.events.get_events(account, fjid)):
|
if len(gajim.events.get_events(account, fjid)):
|
||||||
|
print 'ici'
|
||||||
# We call this here to avoid race conditions with widget validation
|
# We call this here to avoid race conditions with widget validation
|
||||||
chat_control.read_queue()
|
chat_control.read_queue()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue