Mercurial > prosody-modules
comparison mod_presence_cache/mod_presence_cache.lua @ 2292:54f44365a378
mod_presence_cache: Ignore stanzas to self (fixes traceback on probe to self)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 29 Aug 2016 01:06:42 +0200 |
| parents | b76b062e77db |
| children | b718092e442f |
comparison
equal
deleted
inserted
replaced
| 2291:1eeda34d668b | 2292:54f44365a378 |
|---|---|
| 77 local origin, stanza = event.origin, event.stanza; | 77 local origin, stanza = event.origin, event.stanza; |
| 78 if stanza.attr.type ~= "probe" then return; end | 78 if stanza.attr.type ~= "probe" then return; end |
| 79 | 79 |
| 80 local username = origin.username; | 80 local username = origin.username; |
| 81 local contact_bare = stanza.attr.to; | 81 local contact_bare = stanza.attr.to; |
| 82 if not contact_bare then return; end -- probe to self | |
| 82 | 83 |
| 83 local bare_cache_key = username .. "\0" .. contact_bare; | 84 local bare_cache_key = username .. "\0" .. contact_bare; |
| 84 | 85 |
| 85 local cached = bare_cache[bare_cache_key]; | 86 local cached = bare_cache[bare_cache_key]; |
| 86 if not cached then return end | 87 if not cached then return end |
