From 4a6555f00d4a48cde44f7748bfafe401832fb7de Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 1 Sep 2005 19:58:35 +0000 Subject: [PATCH] Added chatserver check --- ChangeLog | 4 ++++ mbtask/taskcomm.c | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ad227eb..4dcd4ef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,10 @@ v0.71.5 18-Aug-2005 asking the user. Added logging during execute of mbuseradd. + mbtask: + Added check to some chat commands to check if the chat thread + is running. + mbsetup: Added node setup switch to override node Hold or Down status. Changed syntax for calling mbpasswd. diff --git a/mbtask/taskcomm.c b/mbtask/taskcomm.c index ad229a04..df6f07bc 100644 --- a/mbtask/taskcomm.c +++ b/mbtask/taskcomm.c @@ -45,6 +45,7 @@ extern struct sockaddr_un from; /* From socket address */ extern int fromlen; /* From address length */ extern int logtrans; /* Log transactions */ extern int T_Shutdown; /* Program shutdown */ +extern int ibc_run; /* Chatserver running */ int cmd_run = FALSE;/* cmd running */ @@ -280,10 +281,14 @@ char *exe_cmd(char *in) * 100:0; Ok */ if (strncmp(cmd, "CPAG", 4) == 0) { - if ((result = reg_page(token))) { - snprintf(obuf, SS_BUFSIZE, "100:1,%d;", result); - Syslog('+', "%s", obuf); + if (ibc_run) { + if ((result = reg_page(token))) { + snprintf(obuf, SS_BUFSIZE, "100:1,%d;", result); + } + } else { + snprintf(obuf, SS_BUFSIZE, "100:1,3;"); } + Syslog('+', "%s", obuf); return obuf; } @@ -327,7 +332,10 @@ char *exe_cmd(char *in) * 100:0; Ok */ if (strncmp(cmd, "CCON", 4) == 0) { - return chat_connect(token); + if (ibc_run) + return chat_connect(token); + else + return ebuf; } /*