plugins/mod_presence.lua
changeset 3182 a19dbb6446a0
parent 3181 1f73b3a960cf
child 3183 28a5c0bda928
equal deleted inserted replaced
3181:1f73b3a960cf 3182:a19dbb6446a0
   185 	local node, host = jid_split(from_bare);
   185 	local node, host = jid_split(from_bare);
   186 	if to_bare == origin.username.."@"..origin.host then return; end -- No self contacts
   186 	if to_bare == origin.username.."@"..origin.host then return; end -- No self contacts
   187 	local st_from, st_to = stanza.attr.from, stanza.attr.to;
   187 	local st_from, st_to = stanza.attr.from, stanza.attr.to;
   188 	stanza.attr.from, stanza.attr.to = from_bare, to_bare;
   188 	stanza.attr.from, stanza.attr.to = from_bare, to_bare;
   189 	log("debug", "outbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);
   189 	log("debug", "outbound presence "..stanza.attr.type.." from "..from_bare.." for "..to_bare);
   190 	if stanza.attr.type == "subscribe" then
   190 	if stanza.attr.type == "probe" then
       
   191 		stanza.attr.from, stanza.attr.to = st_from, st_to;
       
   192 		return;
       
   193 	elseif stanza.attr.type == "subscribe" then
   191 		-- 1. route stanza
   194 		-- 1. route stanza
   192 		-- 2. roster push (subscription = none, ask = subscribe)
   195 		-- 2. roster push (subscription = none, ask = subscribe)
   193 		if rostermanager.set_contact_pending_out(node, host, to_bare) then
   196 		if rostermanager.set_contact_pending_out(node, host, to_bare) then
   194 			rostermanager.roster_push(node, host, to_bare);
   197 			rostermanager.roster_push(node, host, to_bare);
   195 		end -- else file error
   198 		end -- else file error