Closed irssibot closed 8 years ago
irssi-awaylog-write_buffer.patch
--- irssi-0.8.15.orig/src/core/log-away.c 2010-04-03 19:19:38.000000000 +0300
+++ irssi-0.8.15/src/core/log-away.c 2011-01-07 13:16:55.906942008 +0200
@@ -62,6 +62,8 @@
return;
}
+ write_buffer_flush(); // To get correct filepos
+
awaylog = log;
away_filepos = lseek(log->handle, 0, SEEK_CUR);
away_msgs = 0;
@@ -83,6 +85,8 @@
if (awaylog == log) awaylog = NULL;
+ write_buffer_flush();
+
signal_emit("awaylog show", 3, log, GINT_TO_POINTER(away_msgs),
GINT_TO_POINTER(away_filepos));
log_close(log);
Steps to reproduce:
/set write_buffer_size 2MB
/set write_buffer_timeout 10min /away gone
/away
Irssi prints just the note that there is "1 new messages in awaylog", but the actual message is missing because it is still in the write buffer.
The attached patch fixes this problem (applies against 0.8.15 or svn r5202).