Mercurial > prosody-hg
comparison plugins/mod_csi_simple.lua @ 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 | 5c820553ef82 |
| children | 228bd43fbc3d |
comparison
equal
deleted
inserted
replaced
| 11379:5c820553ef82 | 11380:9a1758c5aaa4 |
|---|---|
| 126 end | 126 end |
| 127 flush_reasons[why or "important"](); | 127 flush_reasons[why or "important"](); |
| 128 session.log("debug", "Flushing buffer (%s; queue size is %d)", why or "important", session.csi_counter); | 128 session.log("debug", "Flushing buffer (%s; queue size is %d)", why or "important", session.csi_counter); |
| 129 session.conn:resume_writes(); | 129 session.conn:resume_writes(); |
| 130 session.state = "flushing"; | 130 session.state = "flushing"; |
| 131 module:fire_event("csi-flushing", { session = session }); | |
| 131 else | 132 else |
| 132 session.log("debug", "Holding buffer (%s; queue size is %d)", why or "unimportant", session.csi_counter); | 133 session.log("debug", "Holding buffer (%s; queue size is %d)", why or "unimportant", session.csi_counter); |
| 133 stanza = with_timestamp(stanza, jid.join(session.username, session.host)) | 134 stanza = with_timestamp(stanza, jid.join(session.username, session.host)) |
| 134 end | 135 end |
| 135 session.csi_counter = ctr + 1; | 136 session.csi_counter = ctr + 1; |
