# HG changeset patch # User Kim Alvefur # Date 1554099717 -7200 # Node ID 700340b5785105e000b404326a7344a5a7f67cab # Parent d8c4543f1b1947030eedf95bd58d789786fc0f0d mod_csi_muc_priorities: Break out room jid into a variable diff -r d8c4543f1b19 -r 700340b57851 mod_csi_muc_priorities/mod_csi_muc_priorities.lua --- a/mod_csi_muc_priorities/mod_csi_muc_priorities.lua Mon Apr 01 08:07:41 2019 +0200 +++ b/mod_csi_muc_priorities/mod_csi_muc_priorities.lua Mon Apr 01 08:21:57 2019 +0200 @@ -1,4 +1,4 @@ -local jid = require "util.jid"; +local jid_bare = require "util.jid".bare; module:hook("csi-is-stanza-important", function (event) local stanza, session = event.stanza, event.session; @@ -7,10 +7,12 @@ local body = stanza:get_child_text("body"); if not body then return end + local room_jid = jid_bare(stanza.attr.from); + local rooms = session.rooms_joined; if not rooms then return; end - local room_nick = rooms[jid.bare(stanza.attr.from)]; + local room_nick = rooms[room_jid]; if room_nick and body:find(room_nick, 1, true) then return true; end return false;