diff options
Diffstat (limited to 'plugins/mod_roster.lua')
-rw-r--r-- | plugins/mod_roster.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua index 39d59cbd..37fa197a 100644 --- a/plugins/mod_roster.lua +++ b/plugins/mod_roster.lua @@ -10,6 +10,7 @@ local st = require "util.stanza" local jid_split = require "util.jid".split; +local jid_resource = require "util.jid".resource; local jid_prep = require "util.jid".prep; local tonumber = tonumber; local pairs = pairs; @@ -66,15 +67,14 @@ module:hook("iq/self/jabber:iq:roster:query", function(event) local item = query.tags[1]; local from_node, from_host = jid_split(stanza.attr.from); local jid = jid_prep(item.attr.jid); - local node, host, resource = jid_split(jid); - if not resource and host then + if jid and not jid_resource(jid) then if jid ~= from_node.."@"..from_host then if item.attr.subscription == "remove" then local roster = session.roster; local r_item = roster[jid]; if r_item then module:fire_event("roster-item-removed", { - username = node, jid = jid, item = r_item, origin = session, roster = roster, + username = from_node, jid = jid, item = r_item, origin = session, roster = roster, }); local success, err_type, err_cond, err_msg = rm_remove_from_roster(session, jid); if success then |