Remove the paused timed event when we send the message

This commit is contained in:
Florent Le Coz 2011-04-17 15:49:38 +02:00
parent d1a797205a
commit da76355af0
3 changed files with 10 additions and 2 deletions

View file

@ -1398,6 +1398,11 @@ class Core(object):
self.focus_tab_named(roster_row.get_jid().full) self.focus_tab_named(roster_row.get_jid().full)
self.refresh_window() self.refresh_window()
def remove_timed_event(self, event):
if event and event in self.timed_events:
log.debug('removing event')
self.timed_events.remove(event)
def add_timed_event(self, event): def add_timed_event(self, event):
self.timed_events.add(event) self.timed_events.add(event)

View file

@ -336,7 +336,7 @@ class ChatTab(Tab):
if self.timed_event_paused: if self.timed_event_paused:
event = self.timed_event_paused() event = self.timed_event_paused()
if event: if event:
self.core.timed_events.remove(event) self.core.remove_timed_event(event)
del event del event
self.timed_event_paused = None self.timed_event_paused = None
@ -619,6 +619,7 @@ class MucTab(ChatTab):
msg['xhtml_im'] = xhtml.poezio_colors_to_html(line) msg['xhtml_im'] = xhtml.poezio_colors_to_html(line)
if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False: if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates is not False:
msg['chat_state'] = 'active' msg['chat_state'] = 'active'
self.cancel_paused_delay()
msg.send() msg.send()
def command_ignore(self, arg): def command_ignore(self, arg):
@ -986,6 +987,7 @@ class PrivateTab(ChatTab):
msg.send() msg.send()
self.core.add_message_to_text_buffer(self.get_room(), line, None, self.core.own_nick) self.core.add_message_to_text_buffer(self.get_room(), line, None, self.core.own_nick)
logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line) logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line)
self.cancel_paused_delay()
self.text_win.refresh(self._room) self.text_win.refresh(self._room)
self.input.refresh() self.input.refresh()
@ -1421,6 +1423,7 @@ class ConversationTab(ChatTab):
msg.send() msg.send()
self.core.add_message_to_text_buffer(self.get_room(), line, None, self.core.own_nick) self.core.add_message_to_text_buffer(self.get_room(), line, None, self.core.own_nick)
logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line) logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line)
self.cancel_paused_delay()
self.text_win.refresh(self._room) self.text_win.refresh(self._room)
self.input.refresh() self.input.refresh()

View file

@ -1340,7 +1340,7 @@ class RosterWin(Win):
if y-self.start_pos+1 == self.height: if y-self.start_pos+1 == self.height:
break break
line = ' '*self.width line = ' '*self.width
while y <= self.height: while y < self.height:
self.addstr(y, 0, line) self.addstr(y, 0, line)
y += 1 y += 1
if self.start_pos > 1: if self.start_pos > 1: