Cleanups.
This commit is contained in:
parent
a21488ead6
commit
51f5a91664
@ -1473,7 +1473,7 @@ static int irc_part(struct link_server *server, struct line *line)
|
||||
free(s_nick);
|
||||
|
||||
log_part(LINK(server)->log, line->origin, s_chan,
|
||||
line->elemc == 3 ? line->elemv[2]:NULL);
|
||||
line->elemc == 3 ? line->elemv[2] : NULL);
|
||||
|
||||
nick_free(nick);
|
||||
return OK_COPY;
|
||||
|
11
src/log.c
11
src/log.c
@ -362,6 +362,8 @@ logfilegroup_t *log_find_file(log_t *logdata, char *destination)
|
||||
|
||||
/*
|
||||
* Da log routines
|
||||
* There are a lot of snprintf's here without enforcing the last \0 in the
|
||||
* buffer, but _log_write takes care of this for us.
|
||||
*/
|
||||
void log_join(log_t *logdata, char *ircmask, char *channel)
|
||||
{
|
||||
@ -374,9 +376,14 @@ void log_join(log_t *logdata, char *ircmask, char *channel)
|
||||
void log_part(log_t *logdata, char *ircmask, char *channel,
|
||||
char *message)
|
||||
{
|
||||
snprintf(logdata->buffer, LOGLINE_MAXLEN,
|
||||
if (message)
|
||||
snprintf(logdata->buffer, LOGLINE_MAXLEN,
|
||||
"%s -!- %s has left %s [%s]", timestamp(), ircmask,
|
||||
channel, message);
|
||||
else
|
||||
snprintf(logdata->buffer, LOGLINE_MAXLEN,
|
||||
"%s -!- %s has left %s", timestamp(), ircmask,
|
||||
channel);
|
||||
log_write(logdata, channel, logdata->buffer);
|
||||
}
|
||||
|
||||
@ -424,7 +431,7 @@ static void _log_privmsg(log_t *logdata, char *ircmask, int src,
|
||||
char *real_message = message;
|
||||
|
||||
if (*message == '+' || *message == '-')
|
||||
real_message++;
|
||||
real_message++;
|
||||
|
||||
if (strncmp(real_message, "\001ACTION ", 8) != 0)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user