Commit 05e5b48d authored by Justin Mitchell's avatar Justin Mitchell
Browse files

Remove user online check from .notsayto command, fixes #14

replace user online check offered to scripts
parent ff58d063
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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) {
+0 −13
Original line number Diff line number Diff line
@@ -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);

+0 −3
Original line number Diff line number Diff line
@@ -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);