[mw-devel] MW3 r1086 - trunk/src

arthur at sucs.org arthur at sucs.org
Thu Apr 23 17:38:22 BST 2009


Author: arthur
Date: 2009-04-23 17:38:22 +0100 (Thu, 23 Apr 2009)
New Revision: 1086

Modified:
   trunk/src/incoming.c
   trunk/src/main.c
   trunk/src/proto.h
   trunk/src/talker_privs.c
Log:
pass the usernames through more, refs #32 and #45


Modified: trunk/src/incoming.c
===================================================================
--- trunk/src/incoming.c	2009-04-23 15:44:34 UTC (rev 1085)
+++ trunk/src/incoming.c	2009-04-23 16:38:22 UTC (rev 1086)
@@ -51,16 +51,16 @@
 static void force_rpc(char *text, char *from);
 static void force_checkonoff(char *text, char *from);
 static void force_wiz(char *text, char *from);
-static void force_chatmode(char *text, unsigned long theirprivs, char *from);
+static void force_chatmode(char *text, unsigned long theirprivs, const char *from);
 static void force_status(char *text, char *from);
 static void force_channel(char *text, char *from, unsigned long theirprivs);
 static void force_kick(char *text, char *from, unsigned long theirprivs);
-static void force_gag(char *text, unsigned long theirprivs);
+static void force_gag(char *text, unsigned long theirprivs, const char *from);
 static void zod(char *from, char *msg);
 static void mrod(char *from, char *msg);
 static void force_newmail(void);
 static void force_clearign(void);
-static void force_protlevel(char *text, unsigned long theirprivs);
+static void force_protlevel(char *text, unsigned long theirprivs, const char *from);
 static void force_protpower(char *text);
 
 void InsertMesg(struct mstack *new)
@@ -553,10 +553,10 @@
 			force_chatmode(newbuff, mesg_user->chatprivs, mesg_user->name);
 			break;
 		case IPC_GAG:
-			force_gag(newbuff, mesg_user->chatprivs);
+			force_gag(newbuff, mesg_user->chatprivs, mesg_user->name);
 			break;
 		case IPC_PROTLEVEL:
-			force_protlevel(newbuff, mesg_user->chatprivs);
+			force_protlevel(newbuff, mesg_user->chatprivs, mesg_user->name);
 			break;
 		case IPC_PROTPOWER:
 			force_protpower(newbuff);
@@ -730,7 +730,7 @@
 	}
 }
 
-static void force_chatmode(char *newbuff, unsigned long theirprivs, char *from)
+static void force_chatmode(char *newbuff, unsigned long theirprivs, const char *from)
 {
 	unsigned long	mm;
 	int		ourapl = (user->chatprivs & CP_PROTMASK) >> CP_PROTSHIFT;
@@ -741,7 +741,7 @@
 	oldchat = cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ALL);
 
 	mm=cm_setbycode(user->chatmode, newbuff);
-	user->chatmode=chatmode_describe(user->chatmode, mm, ourapl, theirapl);
+	user->chatmode=chatmode_describe(user->chatmode, mm, ourapl, theirapl, from);
 
 	if (!cm_flags(user->chatmode, CM_ONCHAT, CM_MODE_ANY) && oldchat)
 	{
@@ -757,7 +757,7 @@
 	disable_rl(1);
 }
 
-static void force_gag(char *newbuff, unsigned long theirprivs)
+static void force_gag(char *newbuff, unsigned long theirprivs, const char *from)
 {
 	unsigned long mm, mm2;
 	int ourapl = (user->chatprivs & CP_PROTMASK) >> CP_PROTSHIFT;
@@ -766,11 +766,11 @@
 
 	mm=cm_setbycode(user->chatmode, "-12345678");
 	mm2=cm_setbycode(mm, newbuff);
-	user->chatmode=chatmode_describe(user->chatmode, mm2, ourapl, theirapl);
+	user->chatmode=chatmode_describe(user->chatmode, mm2, ourapl, theirapl, from);
 	disable_rl(1);
 }
 
-static void force_protlevel(char *newbuff, unsigned long theirprivs)
+static void force_protlevel(char *newbuff, unsigned long theirprivs, const char* from)
 {
 	unsigned long cm, pbits;
 	int level;
@@ -787,7 +787,7 @@
 	cm=user->chatmode;
 	cm ^= pbits; cm &= ~(CM_PROTMASK|CM_PROTECTED); cm ^= pbits;
 
-	user->chatmode=chatmode_describe(user->chatmode, cm, ourapl, theirapl);
+	user->chatmode=chatmode_describe(user->chatmode, cm, ourapl, theirapl, from);
 }
 
 static void force_protpower(char *newbuff)

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2009-04-23 15:44:34 UTC (rev 1085)
+++ trunk/src/main.c	2009-04-23 16:38:22 UTC (rev 1086)
@@ -2213,7 +2213,7 @@
 }
 
 
-void broadcast_onoffcode(int code, int method, char *sourceuser, char *reason)
+void broadcast_onoffcode(int code, int method, const char *sourceuser, const char *reason)
 {
 	char		logofftext[MAXTEXTLENGTH];
 	extern int	talker_logontype;

Modified: trunk/src/proto.h
===================================================================
--- trunk/src/proto.h	2009-04-23 15:44:34 UTC (rev 1085)
+++ trunk/src/proto.h	2009-04-23 16:38:22 UTC (rev 1086)
@@ -58,7 +58,7 @@
 void enable_rl();
 int disable_rl(int savetext);
 void devel_msg(char *func, char *fmt, ...);
-void broadcast_onoffcode(int code, int method, char *sourceuser, char *reason);
+void broadcast_onoffcode(int code, int method, const char *sourceuser, const char *reason);
 /* read.c */
 int get_data(int afile, struct Header *tmp);
 void display_article(struct Header *tmp, int datafile);
@@ -186,7 +186,7 @@
 void show_chatmodes(unsigned long cm, char *tmp, int flag);
 void show_protection(unsigned long cm, unsigned long cp, char *tmp, int ourapl);
 unsigned long cm_setbycode(unsigned long stat, char *string);
-unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl, int theirapl);
+unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl, int theirapl, const char *from);
 int gag_code(char *str);
 char *gag_type(int type);
 char *ungag_name(unsigned long chatmode);

Modified: trunk/src/talker_privs.c
===================================================================
--- trunk/src/talker_privs.c	2009-04-23 15:44:34 UTC (rev 1085)
+++ trunk/src/talker_privs.c	2009-04-23 16:38:22 UTC (rev 1086)
@@ -300,7 +300,7 @@
 	return(new==flags);
 }
 
-unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl, int theirapl)
+unsigned long chatmode_describe(unsigned long old, unsigned long new, int ourapl, int theirapl, const char *from)
 {
 	static char	message[81];
 	unsigned long	add, sub, dif;




More information about the mw-devel mailing list