Software / code / prosody
Comparison
plugins/mod_roster.lua @ 5776:bd0ff8ae98a8
Remove all trailing whitespace
| author | Florian Zeitz <florob@babelmonkeys.de> |
|---|---|
| date | Fri, 09 Aug 2013 17:48:21 +0200 |
| parent | 5372:676e3cf0e565 |
| child | 6613:2aae36312eb9 |
comparison
equal
deleted
inserted
replaced
| 5775:a6c2b8933507 | 5776:bd0ff8ae98a8 |
|---|---|
| 1 -- Prosody IM | 1 -- Prosody IM |
| 2 -- Copyright (C) 2008-2010 Matthew Wild | 2 -- Copyright (C) 2008-2010 Matthew Wild |
| 3 -- Copyright (C) 2008-2010 Waqas Hussain | 3 -- Copyright (C) 2008-2010 Waqas Hussain |
| 4 -- | 4 -- |
| 5 -- This project is MIT/X11 licensed. Please see the | 5 -- This project is MIT/X11 licensed. Please see the |
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 34 module:hook("iq/self/jabber:iq:roster:query", function(event) | 34 module:hook("iq/self/jabber:iq:roster:query", function(event) |
| 35 local session, stanza = event.origin, event.stanza; | 35 local session, stanza = event.origin, event.stanza; |
| 36 | 36 |
| 37 if stanza.attr.type == "get" then | 37 if stanza.attr.type == "get" then |
| 38 local roster = st.reply(stanza); | 38 local roster = st.reply(stanza); |
| 39 | 39 |
| 40 local client_ver = tonumber(stanza.tags[1].attr.ver); | 40 local client_ver = tonumber(stanza.tags[1].attr.ver); |
| 41 local server_ver = tonumber(session.roster[false].version or 1); | 41 local server_ver = tonumber(session.roster[false].version or 1); |
| 42 | 42 |
| 43 if not (client_ver and server_ver) or client_ver ~= server_ver then | 43 if not (client_ver and server_ver) or client_ver ~= server_ver then |
| 44 roster:query("jabber:iq:roster"); | 44 roster:query("jabber:iq:roster"); |
| 45 -- Client does not support versioning, or has stale roster | 45 -- Client does not support versioning, or has stale roster |
| 46 for jid, item in pairs(session.roster) do | 46 for jid, item in pairs(session.roster) do |
| 47 if jid ~= "pending" and jid then | 47 if jid ~= "pending" and jid then |