diff mod_ircd/mod_ircd.in.lua @ 484:0b75c7d41b82

mod_ircd: added role check for who sets the topic, to make sure that who sets the topic is actually a moderator.
author Marco Cirillo <maranda@lightwitch.org>
date Mon, 28 Nov 2011 16:07:17 +0000
parents f4ada087c743
children f8cc2be7e16a
line wrap: on
line diff
--- 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)