1 --- a/usr/lib/prosody/modules/mod_presence.lua
2 +++ b/usr/lib/prosody/modules/mod_presence.lua
4 if t ~= nil and t ~= "unavailable" and t ~= "error" then -- check for subscriptions and probes sent to bare JID
5 return handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
8 + local from_resource = string.gsub(stanza.attr.from, "^[^/]*/", "", 1);
9 + if from_resource ~= stanza.attr.from then
10 + if string.match(from_resource, "^Messaging%x%x%x%x%x%x%x%x?%x?")
11 + or string.match(from_resource, "^messaging%-smgmailw%x%x%x%x%x%x%x%x")
12 + or string.match(from_resource, "^messaging%-AChromeExtensionw%x%x%x%x%x%x%x%x")
13 + or string.match(from_resource, "^messaging%-TalkGadgetw%x%x%x%x%x%x%x%x")
14 + or string.match(from_resource, "^messaging%-lcsw_hangouts%x%x%x%x%x%x%x%x")
15 + or string.match(from_resource, "^messaging%-lcsw_hangouts_%x%x%x%x%x%x%x%x") then
16 + log("debug", "Voiding presence from: "..stanza.attr.from);
17 + stanza.attr.type = "unavailable";
21 local user = bare_sessions[to];
24 return handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to));
27 + local from_resource = string.gsub(stanza.attr.from, "^[^/]*/", "", 1);
28 + if from_resource ~= stanza.attr.from then
29 + if string.match(from_resource, "^Messaging%x%x%x%x%x%x%x%x?%x?")
30 + or string.match(from_resource, "^messaging%-smgmailw%x%x%x%x%x%x%x%x")
31 + or string.match(from_resource, "^messaging%-AChromeExtensionw%x%x%x%x%x%x%x%x")
32 + or string.match(from_resource, "^messaging%-TalkGadgetw%x%x%x%x%x%x%x%x")
33 + or string.match(from_resource, "^messaging%-lcsw_hangouts%x%x%x%x%x%x%x%x")
34 + or string.match(from_resource, "^messaging%-lcsw_hangouts_%x%x%x%x%x%x%x%x") then
35 + log("debug", "Voiding presence from: "..stanza.attr.from);
36 + stanza.attr.type = "unavailable";
40 local session = full_sessions[stanza.attr.to];
42 -- TODO fire post processing event