From 496bbc8b74a67e2eb9da305acef89bcea32726fc Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sat, 8 Jul 2017 21:49:59 +1000 Subject: [PATCH] Add send_text() flag STXT_LOG Eventually to replace the 'log' parameter to send_text(). --- include/irc.h | 5 +++-- source/commands.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/irc.h b/include/irc.h index ae1c094..37cccc0 100644 --- a/include/irc.h +++ b/include/irc.h @@ -166,8 +166,9 @@ extern char thing_star[4]; #endif /* send_text flag values */ -#define STXT_NOTICE 0x0001U -#define STXT_QUIET 0x0002U +#define STXT_NOTICE 0x0001U /* Send as a NOTICE rather than PRIVMSG. */ +#define STXT_QUIET 0x0002U /* Do not run hooks or screen output. */ +#define STXT_LOG 0x0004U /* Add sent message to the log file. */ /* This section is for keeping track internally * the CVS revision info of the running client. diff --git a/source/commands.c b/source/commands.c index f511d58..083a341 100644 --- a/source/commands.c +++ b/source/commands.c @@ -3871,7 +3871,7 @@ int current_target = 0; void BX_send_text(const char *nick_list, const char *text, char *command, int hook, int log) { static int sent_text_recursion = 0; - unsigned flags = hook ? 0 : STXT_QUIET; + unsigned flags = (hook ? 0 : STXT_QUIET) | (log ? STXT_LOG : 0); int i, done_forward = 0, @@ -3989,7 +3989,7 @@ void BX_send_text(const char *nick_list, const char *text, char *command, int h } /* log it if logging on */ - if (log) + if (flags & STXT_LOG) logmsg(LOG_SEND_MSG, target[i].nick_list, 0, "%s", text); /* save this for /oops */