Comparison

core/stanza_router.lua @ 172:71247788c7c7

Inbound subscription cancellation
author Waqas Hussain <waqas20@gmail.com>
date Sat, 25 Oct 2008 02:29:58 +0500
parent 171:28f420d057a0
child 173:f3a2af4d2ff2
comparison
equal deleted inserted replaced
171:28f420d057a0 172:71247788c7c7
209 elseif stanza.attr.type == "subscribe" then 209 elseif stanza.attr.type == "subscribe" then
210 -- TODO 210 -- TODO
211 elseif stanza.attr.type == "unsubscribe" then 211 elseif stanza.attr.type == "unsubscribe" then
212 -- TODO 212 -- TODO
213 elseif stanza.attr.type == "subscribed" then 213 elseif stanza.attr.type == "subscribed" then
214 -- TODO
215 if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then 214 if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then
216 rostermanager.roster_push(node, host, from_bare); 215 rostermanager.roster_push(node, host, from_bare);
217 for k in pairs(user.sessions) do -- return presence for all resources 216 for k in pairs(user.sessions) do -- return presence for all resources
218 local pres = user.sessions[k].presence; 217 local pres = user.sessions[k].presence;
219 if pres then 218 if pres then
224 end 223 end
225 pres.attr.to = nil; 224 pres.attr.to = nil;
226 pres.attr.from = nil; 225 pres.attr.from = nil;
227 end 226 end
228 elseif stanza.attr.type == "unsubscribed" then 227 elseif stanza.attr.type == "unsubscribed" then
229 -- TODO 228 if rostermanager.process_inbound_subscription_approval(node, host, from_bare) then
229 rostermanager.roster_push(node, host, from_bare);
230 end
230 end -- discard any other type 231 end -- discard any other type
231 else -- sender is available or unavailable 232 else -- sender is available or unavailable
232 for k in pairs(user.sessions) do -- presence broadcast to all user resources 233 for k in pairs(user.sessions) do -- presence broadcast to all user resources
233 if user.sessions[k].full_jid then 234 if user.sessions[k].full_jid then
234 stanza.attr.to = user.sessions[k].full_jid; -- reset at the end of function 235 stanza.attr.to = user.sessions[k].full_jid; -- reset at the end of function