Comparison

plugins/mod_presence.lua @ 1162:bd1f0e6d50a7

Merging SASL buggy client workaround with current tip.
author Tobias Markmann <tm@ayena.de>
date Fri, 15 May 2009 17:33:04 +0200
parent 1150:d71a8f28f18b
child 1209:86b01a837126
comparison
equal deleted inserted replaced
1161:5bc2b7b5b81d 1162:bd1f0e6d50a7
250 local to_bare = jid_bare(to); 250 local to_bare = jid_bare(to);
251 local from_bare = jid_bare(stanza.attr.from); 251 local from_bare = jid_bare(stanza.attr.from);
252 if origin.type == "c2s" then 252 if origin.type == "c2s" then
253 if to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence 253 if to ~= nil and not(origin.roster[to_bare] and (origin.roster[to_bare].subscription == "both" or origin.roster[to_bare].subscription == "from")) then -- directed presence
254 origin.directed = origin.directed or {}; 254 origin.directed = origin.directed or {};
255 origin.directed[to] = true; 255 origin.directed[to] = true; -- FIXME does it make more sense to add to_bare rather than to?
256 end 256 end
257 if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then 257 if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then
258 handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza); 258 handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
259 elseif not to then 259 elseif not to then
260 handle_normal_presence(origin, stanza, core_route_stanza); 260 handle_normal_presence(origin, stanza, core_route_stanza);
266 handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza); 266 handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);
267 else 267 else
268 core_route_stanza(origin, stanza); 268 core_route_stanza(origin, stanza);
269 end 269 end
270 end 270 end
271 return true;
271 end 272 end
272 273
273 local add_handler = require "core.eventmanager2".add_handler; 274 local add_handler = require "core.eventmanager2".add_handler;
274 local remove_handler = require "core.eventmanager2".remove_handler; 275 local remove_handler = require "core.eventmanager2".remove_handler;
275 276