mod_ircd: added role check for who sets the topic, to make sure that who sets the topic is actually a moderator.
authorMarco Cirillo <maranda@lightwitch.org>
Mon, 28 Nov 2011 16:07:17 +0000
changeset 484 0b75c7d41b82
parent 483 f4ada087c743
child 485 f8cc2be7e16a
mod_ircd: added role check for who sets the topic, to make sure that who sets the topic is actually a moderator.
mod_ircd/mod_ircd.in.lua
--- a/mod_ircd/mod_ircd.in.lua	Mon Nov 28 15:28:10 2011 +0000
+++ b/mod_ircd/mod_ircd.in.lua	Mon Nov 28 16:07:17 2011 +0000
@@ -458,10 +458,7 @@
 	if not channel then return end
 	local room = session.rooms[channel];
 
-	if topic then
-		room:set_subject(topic)
-		session.send((":%s TOPIC %s :%s"):format(room.nick, room.channel, room.subject or ""));
-	end
+	if topic and room.occupants[room.nick]["role"] == "moderator" then room:set_subject(topic); end
 end
 
 function commands.WHO(session, args)