mod_csi_simple: Fire event when flushing queue
authorKim Alvefur <zash@zash.se>
Tue, 16 Feb 2021 23:10:23 +0100
changeset 11384 9a1758c5aaa4
parent 11383 5c820553ef82
child 11386 a0477656258c
mod_csi_simple: Fire event when flushing queue To let other plugins know and take some action, e.g. flushing other buffers or whatnot.
plugins/mod_csi_simple.lua
--- a/plugins/mod_csi_simple.lua	Tue Feb 16 23:09:51 2021 +0100
+++ b/plugins/mod_csi_simple.lua	Tue Feb 16 23:10:23 2021 +0100
@@ -128,6 +128,7 @@
 		session.log("debug", "Flushing buffer (%s; queue size is %d)", why or "important", session.csi_counter);
 		session.conn:resume_writes();
 		session.state = "flushing";
+		module:fire_event("csi-flushing", { session = session });
 	else
 		session.log("debug", "Holding buffer (%s; queue size is %d)", why or "unimportant", session.csi_counter);
 		stanza = with_timestamp(stanza, jid.join(session.username, session.host))