[Operators] Google status?

Holger Weiß holger at zedat.fu-berlin.de
Wed Aug 13 23:57:16 UTC 2014


* Kim Alvefur <zash at zash.se> [2014-08-13 21:50]:
> 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: [...]

Same thing for ejabberd, FWIW:

 -module(mod_hangouts).
 -behaviour(gen_mod).
 -export([start/2, stop/1, block_hangouts/1]).

 -include("ejabberd.hrl").
 -include("jlib.hrl").

 -define(HANGOUTS_JID, #jid{
    lserver = <<"gmail.com">>,
    resource = <<"Messaging", _Rest/binary>>
 }).

 start(_Host, _Opts) ->
    ejabberd_hooks:add(filter_packet, global, ?MODULE, block_hangouts, 10),
    ok.

 stop(_Host) ->
    ejabberd_hooks:delete(filter_packet, global, ?MODULE, block_hangouts, 10),
    ok.

 block_hangouts({From,
                 To = ?HANGOUTS_JID,
                 Packet = #xmlel{name = <<"message">>}}) ->
    Reply = jlib:make_error_reply(Packet, ?ERR_NOT_ALLOWED),
    ejabberd_router:route(To, From, Reply),
    drop;
 block_hangouts({?HANGOUTS_JID, _To, #xmlel{name = <<"presence">>}}) -> drop;
 block_hangouts({From, To, Packet}) -> {From, To, Packet}.

Holger


More information about the Operators mailing list