comparison mod_csi_pump/mod_csi_pump.lua @ 2460:3ed504b944e5

mod_csi_pump: Consider groupchat message with subject important
author Kim Alvefur <zash@zash.se>
date Mon, 23 Jan 2017 16:00:20 +0100
parents dc30ca5ce315
children 956b75b0e9d9
comparison
equal deleted inserted replaced
2459:8e686bf63441 2460:3ed504b944e5
52 elseif st_name == "message" then 52 elseif st_name == "message" then
53 if st_type == "headline" then 53 if st_type == "headline" then
54 return false; 54 return false;
55 end 55 end
56 local body = stanza:get_child_text("body"); 56 local body = stanza:get_child_text("body");
57 if not body then return false; end
58 if st_type == "groupchat" then 57 if st_type == "groupchat" then
58 if stanza:get_child_text("subject") then return true; end
59 if not body then return false; end
59 if body:find(session.username, 1, true) then return true; end 60 if body:find(session.username, 1, true) then return true; end
60 local rooms = session.rooms_joined; 61 local rooms = session.rooms_joined;
61 if not rooms then return false; end 62 if not rooms then return false; end
62 local room_nick = rooms[jid.bare(stanza.attr.from)]; 63 local room_nick = rooms[jid.bare(stanza.attr.from)];
63 if room_nick and body:find(room_nick, 1, true) then return true; end 64 if room_nick and body:find(room_nick, 1, true) then return true; end