From e38ef66393b5ef4f61884c6d2484b535fcbf44d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 24 May 2014 21:42:29 +0200 Subject: [PATCH] Fix lines displayed in wrong buffer on startup The bug was introduced by commit 46e5dee03acce56cdb7b3b65346acc9a5ecd210d (option relay.lines to limit the number of lines received on connection). --- qweechat/qweechat.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qweechat/qweechat.py b/qweechat/qweechat.py index 92a597d..73f7b43 100644 --- a/qweechat/qweechat.py +++ b/qweechat/qweechat.py @@ -359,12 +359,15 @@ class MainWindow(QTGUI.QMainWindow): index = [i for i, b in enumerate(self.buffers) if b.pointer() == ptrbuf] if index: - lines.append((item['date'], item['prefix'], - item['message'])) + lines.append( + (index[0], + (item['date'], item['prefix'], + item['message'])) + ) if message.msgid == 'listlines': lines.reverse() for line in lines: - self.buffers[index[0]].widget.chat.display(*line) + self.buffers[line[0]].widget.chat.display(*line[1]) def _parse_nicklist(self, message): """Parse a WeeChat message with a buffer nicklist."""