Add send_text() flag STXT_LOG

Eventually to replace the 'log' parameter to send_text().
This commit is contained in:
Kevin Easton
2017-07-08 21:49:59 +10:00
parent 1bceb5ed86
commit 496bbc8b74
2 changed files with 5 additions and 4 deletions

View File

@@ -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.

View File

@@ -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 */