Comparison

plugins/mod_presence.lua @ 2143:13ac68e8760b

mod_presence: Route incoming presence subscription stanzas (types unsubscribe, subscribed and unsubscribed) to the user before roster pushes.
author Waqas Hussain <waqas20@gmail.com>
date Sun, 22 Nov 2009 21:47:54 +0500
parent 2142:4b339020607f
child 2228:3987078bb179
comparison
equal deleted inserted replaced
2142:4b339020607f 2143:13ac68e8760b
240 end -- TODO else return error, unable to save 240 end -- TODO else return error, unable to save
241 end 241 end
242 end 242 end
243 elseif stanza.attr.type == "unsubscribe" then 243 elseif stanza.attr.type == "unsubscribe" then
244 if rostermanager.process_inbound_unsubscribe(node, host, from_bare) then 244 if rostermanager.process_inbound_unsubscribe(node, host, from_bare) then
245 sessionmanager.send_to_interested_resources(node, host, stanza);
245 rostermanager.roster_push(node, host, from_bare); 246 rostermanager.roster_push(node, host, from_bare);
246 end 247 end
247 elseif stanza.attr.type == "subscribed" then 248 elseif stanza.attr.type == "subscribed" then
248 if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then 249 if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then
250 sessionmanager.send_to_interested_resources(node, host, stanza);
249 rostermanager.roster_push(node, host, from_bare); 251 rostermanager.roster_push(node, host, from_bare);
250 end 252 end
251 elseif stanza.attr.type == "unsubscribed" then 253 elseif stanza.attr.type == "unsubscribed" then
252 if rostermanager.process_inbound_subscription_cancellation(node, host, from_bare) then 254 if rostermanager.process_inbound_subscription_cancellation(node, host, from_bare) then
255 sessionmanager.send_to_interested_resources(node, host, stanza);
253 rostermanager.roster_push(node, host, from_bare); 256 rostermanager.roster_push(node, host, from_bare);
254 end 257 end
255 end -- discard any other type 258 end -- discard any other type
256 stanza.attr.from, stanza.attr.to = st_from, st_to; 259 stanza.attr.from, stanza.attr.to = st_from, st_to;
257 end 260 end