Mercurial > prosody-modules
comparison mod_muc_intercom/mod_muc_intercom.lua @ 260:1fdd201c1d43
Merge Zash->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 10 Oct 2010 21:37:44 +0100 |
parents | 7410d1005fea |
children | 6d72c5172c74 |
comparison
equal
deleted
inserted
replaced
259:d137515e0701 | 260:1fdd201c1d43 |
---|---|
17 if not from_room_jid then return; end -- no such nick | 17 if not from_room_jid then return; end -- no such nick |
18 | 18 |
19 local from_room, from_host, from_nick = jid.split(from_room_jid); | 19 local from_room, from_host, from_nick = jid.split(from_room_jid); |
20 | 20 |
21 local body = stanza:get_child("body"); | 21 local body = stanza:get_child("body"); |
22 if not body then return; end -- No body, like topic changes | |
22 body = body and body:get_text(); -- I feel like I want to do `or ""` there :/ | 23 body = body and body:get_text(); -- I feel like I want to do `or ""` there :/ |
23 local target_room, message = body:match("^@([^:]+):(.*)"); | 24 local target_room, message = body:match("^@([^:]+):(.*)"); |
24 if not target_room or not message then return; end | 25 if not target_room or not message then return; end |
25 | 26 |
26 if target_room == from_room then return; end -- don't route to itself | 27 if target_room == from_room then return; end -- don't route to itself |