Last active
August 29, 2015 14:05
-
-
Save santiago26/fa3bd56743e8c546c205 to your computer and use it in GitHub Desktop.
Popup in the regular XMPP clients each time somebody tries to start a new chat with a user @gmail.com and doesn't receive a response in 2 minutes. "Warning: the person you have tried to contact uses gmail.com. It is possible that their account has been migrated to the Hangouts platform and that Google has silently discarded chats you send them. …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- by Kim Alvefur | |
-- Popup in the regular XMPP clients each time somebody tries to start a new chat with a user @gmail.com and doesn't receive a response in 2 minutes. "Warning: the person you have tried to contact uses gmail.com. It is possible that their account has been migrated to the Hangouts platform and that Google has silently discarded chats you send them. Please click here for a help page you can email to your contact to fix their account." | |
-- This logic can be refined. The broken resources start with "Messaging". | |
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment