[mw-devel] MW3 r1250 - trunk/src

arthur at sucs.org arthur at sucs.org
Mon Jun 6 09:50:39 BST 2011


Author: arthur
Date: 2011-06-06 09:50:39 +0100 (Mon, 06 Jun 2011)
New Revision: 1250

Modified:
   trunk/src/chattable.c
   trunk/src/talker.c
Log:
Let non-admins run the topic command, but not change it


Modified: trunk/src/chattable.c
===================================================================
--- trunk/src/chattable.c	2011-04-12 19:07:32 UTC (rev 1249)
+++ trunk/src/chattable.c	2011-06-06 08:50:39 UTC (rev 1250)
@@ -70,7 +70,7 @@
 {"sticky"	,0x0000	,1, "Usage: sticky <on|off>", "Log back on to the room you logged off from", t_sticky, 1},
 {"summon"	,0x0080	,2, "Usage: summon <room> <user> [<user>...]", "Force user(s) to move into a room", t_summon, 1},
 {"tcunames"	,0x0000, 1, "Usage: tcunames <on|off>", "Allow tab-completion of username on talker", t_tcunames, 1},
-{"topic"	,0x0800, 0, "Usage: topic [topic]", "Set/view channel topic", t_topic, 1},
+{"topic"	,0x0000, 0, "Usage: topic [topic]", "Set/view channel topic", t_topic, 1},
 {"unbind"	,0x0200, 1, "Usage: unbind <bind | *>", "Remove the bind from the current session", t_unbind, 1},
 {"unevent"	,0x0200	,1, "Usage: unevent <function | *>", "Unset [all] text event handler function(s)", t_unevent, 1},
 {"unfreeze"	,0x0040	,1, "Usage: unfreeze <user>", "Allow user to change rooms again", t_unfreeze, 1},

Modified: trunk/src/talker.c
===================================================================
--- trunk/src/talker.c	2011-04-12 19:07:32 UTC (rev 1249)
+++ trunk/src/talker.c	2011-06-06 08:50:39 UTC (rev 1250)
@@ -1381,7 +1381,8 @@
 		display_message(buff, 0, 1);
 		if (topic != NULL) free(topic);
 		return;
-	} else {
+	} else
+	if (u_god(user->status))  {
 		char text[MAXTEXTLENGTH];
 		const char *topic;
 
@@ -1397,6 +1398,8 @@
 			mwlog("TOPIC %s", topic);
 		}
 		talk_send_raw(text,user->room);
+	} else {
+		display_message("Sorry, only admins can change the topic.", 0, 1);
 	}
 }
 




More information about the mw-devel mailing list