Software / code / prosody
Comparison
plugins/mod_csi_simple.lua @ 9632:fdefc43bffff 0.11
mod_csi_simple: Consider non-stanza objects important
Most cases are for keepalive or stream closing, where it needs to be
flushed anyways.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 17 Nov 2018 15:36:10 +0100 |
| parent | 9631:d6104aaf94bc |
| child | 9644:e31547ab1ca2 |
comparison
equal
deleted
inserted
replaced
| 9631:d6104aaf94bc | 9632:fdefc43bffff |
|---|---|
| 46 | 46 |
| 47 local queue_size = module:get_option_number("csi_queue_size", 256); | 47 local queue_size = module:get_option_number("csi_queue_size", 256); |
| 48 | 48 |
| 49 module:hook("csi-is-stanza-important", function (event) | 49 module:hook("csi-is-stanza-important", function (event) |
| 50 local stanza = event.stanza; | 50 local stanza = event.stanza; |
| 51 if not st.is_stanza(stanza) then | |
| 52 return true; | |
| 53 end | |
| 51 local st_name = stanza.name; | 54 local st_name = stanza.name; |
| 52 if not st_name then return false; end | 55 if not st_name then return false; end |
| 53 local st_type = stanza.attr.type; | 56 local st_type = stanza.attr.type; |
| 54 if st_name == "presence" then | 57 if st_name == "presence" then |
| 55 if st_type == nil or st_type == "unavailable" then | 58 if st_type == nil or st_type == "unavailable" then |