comparison mod_presence_cache/mod_presence_cache.lua @ 2145:f965f86a5cad

mod_presence_cache: Check stanzas only from s2sin (not needed, even with mod_bidi)
author Kim Alvefur <zash@zash.se>
date Fri, 01 Apr 2016 15:11:25 +0200
parents d843e8f1ed78
children 39d958f4a0c3
comparison
equal deleted inserted replaced
2144:ead81e222fde 2145:f965f86a5cad
10 10
11 local function cache_hook(event) 11 local function cache_hook(event)
12 local origin, stanza = event.origin, event.stanza; 12 local origin, stanza = event.origin, event.stanza;
13 local typ = stanza.attr.type; 13 local typ = stanza.attr.type;
14 module:log("debug", "Cache hook, got %s from a %s", stanza:top_tag(), origin.type); 14 module:log("debug", "Cache hook, got %s from a %s", stanza:top_tag(), origin.type);
15 if origin.type:match"^s2s" and ( typ == nil or typ == "unavailable" ) then 15 if origin.type == "s2sin" and ( typ == nil or typ == "unavailable" ) then
16 local from_jid = stanza.attr.from; 16 local from_jid = stanza.attr.from;
17 local from_bare = jid_bare(from_jid); 17 local from_bare = jid_bare(from_jid);
18 local username = jid_split(stanza.attr.to); 18 local username = jid_split(stanza.attr.to);
19 19
20 if not is_contact_subscribed(username, module.host, from_bare) then 20 if not is_contact_subscribed(username, module.host, from_bare) then