On 2014-08-13 21:34, David Holl wrote: > I like the idea of the server-side kludge, never mind that it is ugly to > implement such a special case. But we can holy war some other time > about what's uglier Google's broken implementation, or the value in > raising awareness of the issues at hand... > > Server-side Prosody plugin, anyone?
Here you go, save as mod_hangouts.lua or whatever:
local st = require"util.stanza"
local jid_split = require"util.jid".split;
module:hook("pre-message/full", function (event)
local origin, stanza = event.origin, event.stanza;
local node, host, resource = jid_split(stanza.attr.to);
if resource and resource:match"^Messaging" then
return origin.send(st.error_reply(stanza, "cancel",
"not-acceptable",
"One does not simply chat with a Hangouts user"));
end
end);
local function drop_hangouts_presence(event)
local node, host, resource = jid_split(event.stanza.attr.from);
if resource and resource:match"^Messaging" then
return true -- Drop
end
end
module:hook("presence/bare", drop_hangouts_presence);
module:hook("presence/full", drop_hangouts_presence);
signature.asc
Description: OpenPGP digital signature
