Mercurial > prosody-modules
view mod_csi_muc_priorities/mod_csi_muc_priorities.lua @ 3535:bcb0eb9121a9
mod_csi_muc_priorities: Add a comment
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 01 Apr 2019 08:22:29 +0200 |
parents | 700340b57851 |
children | eed657091329 |
line wrap: on
line source
local jid_bare = require "util.jid".bare; module:hook("csi-is-stanza-important", function (event) local stanza, session = event.stanza, event.session; if stanza.name == "message" then if stanza.attr.type == "groupchat" then local body = stanza:get_child_text("body"); if not body then return end local room_jid = jid_bare(stanza.attr.from); -- Look for mention local rooms = session.rooms_joined; if not rooms then return; end local room_nick = rooms[room_jid]; if room_nick and body:find(room_nick, 1, true) then return true; end return false; end end end);