Don't lose the original message when scrolling down from the end in the sent message history.
This commit is contained in:
parent
49431d89c0
commit
7fe4cd958e
|
@ -1208,10 +1208,6 @@ class Chat:
|
||||||
|
|
||||||
def sent_messages_scroll(self, jid, direction, conv_buf):
|
def sent_messages_scroll(self, jid, direction, conv_buf):
|
||||||
size = len(self.sent_history[jid])
|
size = len(self.sent_history[jid])
|
||||||
if direction == 'up':
|
|
||||||
if self.sent_history_pos[jid] == 0:
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.typing_new[jid]:
|
if self.typing_new[jid]:
|
||||||
#user was typing something and then went into history, so save
|
#user was typing something and then went into history, so save
|
||||||
#whatever is already typed
|
#whatever is already typed
|
||||||
|
@ -1219,7 +1215,9 @@ class Chat:
|
||||||
end_iter = conv_buf.get_end_iter()
|
end_iter = conv_buf.get_end_iter()
|
||||||
self.orig_msg[jid] = conv_buf.get_text(start_iter, end_iter, 0).decode('utf-8')
|
self.orig_msg[jid] = conv_buf.get_text(start_iter, end_iter, 0).decode('utf-8')
|
||||||
self.typing_new[jid] = False
|
self.typing_new[jid] = False
|
||||||
|
if direction == 'up':
|
||||||
|
if self.sent_history_pos[jid] == 0:
|
||||||
|
return
|
||||||
self.sent_history_pos[jid] = self.sent_history_pos[jid] - 1
|
self.sent_history_pos[jid] = self.sent_history_pos[jid] - 1
|
||||||
conv_buf.set_text(self.sent_history[jid][self.sent_history_pos[jid]])
|
conv_buf.set_text(self.sent_history[jid][self.sent_history_pos[jid]])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue