Mercurial > prosody-modules
comparison mod_throttle_presence/mod_throttle_presence.lua @ 1867:34468d3bfcac
mod_throttle_presence: Skip past things that are not stanza objects
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 21 Sep 2015 23:45:45 +0200 |
parents | b8164f18142a |
children | 552faee596b7 |
comparison
equal
deleted
inserted
replaced
1866:58d96960ba8b | 1867:34468d3bfcac |
---|---|
2 local st = require "util.stanza"; | 2 local st = require "util.stanza"; |
3 | 3 |
4 module:depends("csi"); | 4 module:depends("csi"); |
5 | 5 |
6 local function presence_filter(stanza, session) | 6 local function presence_filter(stanza, session) |
7 if getmetatable(stanza) ~= st.stanza_mt then | |
8 return stanza; -- Things we don't want to touch | |
9 end | |
7 if stanza._flush then | 10 if stanza._flush then |
8 stanza._flush = nil; | 11 stanza._flush = nil; |
9 return stanza; | 12 return stanza; |
10 end | 13 end |
11 local buffer = session.presence_buffer; | 14 local buffer = session.presence_buffer; |