[mw-devel] [Git][arthur/mw][master] Remove user online check from .notsayto command, fixes #14

Justin Mitchell arthur at sucs.org
Fri Jan 22 15:36:49 GMT 2016


Justin Mitchell pushed to branch master at Justin Mitchell / mw


Commits:
05e5b48d by Justin Mitchell at 2016-01-22T15:36:13Z
Remove user online check from .notsayto command, fixes #14
replace user online check offered to scripts

- - - - -


3 changed files:

- src/client/script_inst.c
- src/client/talker.c
- src/client/talker.h


Changes:

=====================================
src/client/script_inst.c
=====================================
--- a/src/client/script_inst.c
+++ b/src/client/script_inst.c
@@ -1303,10 +1303,10 @@ void scr_end( struct code *pc, int fargc, char **fargv )
 void scr_ison( struct code *pc, int fargc, char **fargv )
 {
 	char *who;
-	int found;
+	int found = 0;
 
 	who=eval_arg(pc->argv[0], fargc, fargv);
-	found = ison(who);
+	if (who_find(who) != -1) found=1;
 
 	compare_count++;
 	if (found) {


=====================================
src/client/talker.c
=====================================
--- a/src/client/talker.c
+++ b/src/client/talker.c
@@ -106,14 +106,6 @@ void talk_sayto(char *text, const char *to, const char *type)
 	mwlog("SAYTO %s %s",to,text);
 }
 
-int ison(const char * uname)
-{
-    /*
-     * Ask the IPC mechanism if a user is there
-     */
-    return (ipc_send_to_username(uname, IPC_NOOP, NULL) > 0);
-}
-
 int screen_h(void)
 {
 	char	*szLines;
@@ -428,11 +420,6 @@ void t_notsayto(CommandList *cm, int argc, const char **argv, char *args)
 {
 	char text[MAXTEXTLENGTH];
 
-	// check that the excluded person is on
-	if (!ison(argv[1])) {
-	    printf(_("User '%s' is not logged on.\n"), argv[1]);
-	    return;
-	}
 	snprintf(text, MAXTEXTLENGTH, "%s", args);
 	mwlog("NSAYTO %s %s", argv[1], text);
 


=====================================
src/client/talker.h
=====================================
--- a/src/client/talker.h
+++ b/src/client/talker.h
@@ -3,9 +3,6 @@
 
 #include "Parse.h"
 
-/* talker.c */
-int ison(const char * uname);
-
 /* talker command functions */
 void t_bind(CommandList *cm, int argc, const char **argv, char *args);
 void t_unbind(CommandList *cm, int argc, const char **argv, char *args);



View it on GitLab: https://projects.sucs.org/arthur/mw/commit/05e5b48dcbc5dac81546fc0e0f454dc8bf6bd5c1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/mw-devel/attachments/20160122/c88ecb23/attachment.html>


More information about the mw-devel mailing list