Software /
code /
prosody
Comparison
plugins/mod_message.lua @ 3408:e03fd9a16e19
mod_message: Discard headline messages sent to offline full JIDs (to follow latest spec updates).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 26 Jul 2010 02:18:03 +0500 |
parent | 2923:b7049746bd29 |
child | 3968:048af3ee5899 |
comparison
equal
deleted
inserted
replaced
3407:15f633285755 | 3408:e03fd9a16e19 |
---|---|
24 if t == "error" then | 24 if t == "error" then |
25 -- discard | 25 -- discard |
26 elseif t == "groupchat" then | 26 elseif t == "groupchat" then |
27 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 27 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
28 elseif t == "headline" then | 28 elseif t == "headline" then |
29 if user then | 29 if user and stanza.attr.to == bare then |
30 for _, session in pairs(user.sessions) do | 30 for _, session in pairs(user.sessions) do |
31 if session.presence and session.priority >= 0 then | 31 if session.presence and session.priority >= 0 then |
32 session.send(stanza); | 32 session.send(stanza); |
33 end | 33 end |
34 end | 34 end |