Software /
code /
prosody
Comparison
plugins/mod_announce.lua @ 10026:1117138fa372 0.11
mod_announce: Check for admin on current virtualhost instead of global (fixes #1365) (thanks yc)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 27 May 2019 12:05:35 +0200 (2019-05-27) |
parent | 8974:71500c68fed4 |
child | 10545:2fbcdf6da331 |
comparison
equal
deleted
inserted
replaced
10016:af8c514e5cf7 | 10026:1117138fa372 |
---|---|
42 | 42 |
43 if resource ~= "announce/online" then | 43 if resource ~= "announce/online" then |
44 return; -- Not an announcement | 44 return; -- Not an announcement |
45 end | 45 end |
46 | 46 |
47 if not is_admin(stanza.attr.from) then | 47 if not is_admin(stanza.attr.from, host) then |
48 -- Not an admin? Not allowed! | 48 -- Not an admin? Not allowed! |
49 module:log("warn", "Non-admin '%s' tried to send server announcement", stanza.attr.from); | 49 module:log("warn", "Non-admin '%s' tried to send server announcement", stanza.attr.from); |
50 return; | 50 return; |
51 end | 51 end |
52 | 52 |