Changeset

11380:9a1758c5aaa4

mod_csi_simple: Fire event when flushing queue To let other plugins know and take some action, e.g. flushing other buffers or whatnot.
author Kim Alvefur <zash@zash.se>
date Tue, 16 Feb 2021 23:10:23 +0100
parents 11379:5c820553ef82
children 11382:a0477656258c
files plugins/mod_csi_simple.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))