[Operators] Google status?

Kim Alvefur zash at zash.se
Wed Aug 13 19:50:59 UTC 2014

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"));

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

module:hook("presence/bare", drop_hangouts_presence);
module:hook("presence/full", drop_hangouts_presence);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.jabber.org/pipermail/operators/attachments/20140813/19429f35/attachment.sig>

More information about the Operators mailing list