diff mod_ircd/mod_ircd.in.lua @ 482:9d62586e7aae

mod_ircd: hacked around it to make it "work" again, topics should be operational once again.
author Marco Cirillo <maranda@lightwitch.org>
date Mon, 28 Nov 2011 15:07:20 +0000
parents 99b246b37809
children f4ada087c743
line wrap: on
line diff
--- a/mod_ircd/mod_ircd.in.lua	Mon Nov 28 14:00:37 2011 +0000
+++ b/mod_ircd/mod_ircd.in.lua	Mon Nov 28 15:07:20 2011 +0000
@@ -305,7 +305,7 @@
 	commands.NAMES(session, channel);
 	
 	room:hook("subject-changed", function(changed) 
-	       	session.send((":%s TOPIC %s :%s"):format(changed.by, channel, changed.to or ""));
+	       	session.send((":%s TOPIC %s :%s"):format(changed.by.nick, channel, changed.to or ""));
 	end);
 	
 	room:hook("message", function(event)
@@ -447,17 +447,13 @@
 
 function commands.TOPIC(session, message)
 	if not message then return end
-	local channel, topic = message:match("^(%S+) :(.*)$");
-	if not channel then
-		channel = message:match("^(%S+)");
-	end
+	local channel, topic = message[1], message[2]; 
 	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(session.nick, channel, room.subject or ""));
-	else
-		session.send((":%s TOPIC %s :%s"):format(session.nick, channel, room.subject or ""));
+		session.send((":%s TOPIC %s :%s"):format(room.nick, room.channel, room.subject or ""));
 	end
 end