[COSMETIC] Avoid opening a query with your own nic
This exception is cosmetic, but you want it. Most of the time, you get backlog from your own nick for your mode changes only. Hence opening a query just to say "end of backlog"...
This commit is contained in:
parent
744ea7d03b
commit
b3d7dbfb02
@ -868,7 +868,6 @@ static int irc_cli_privmsg(bip_t *bip, struct link_client *ic,
|
||||
if (irc_line_elem_equals(line, 1, "-bip"))
|
||||
return adm_bip(bip, ic, line, 1);
|
||||
|
||||
printf("%d<-\n", LINK(ic)->user->blreset_on_talk);
|
||||
if (LINK(ic)->user->blreset_on_talk)
|
||||
log_reset_store(LINK(ic)->log, irc_line_elem(line, 1));
|
||||
return OK_COPY_CLI;
|
||||
|
26
src/log.c
26
src/log.c
@ -1308,14 +1308,24 @@ list_t *backlog_lines_from_last_mark(log_t *log, const char *bl,
|
||||
|
||||
if (log_has_backlog(log, bl)) {
|
||||
ret = log_backread(log, bl, dest);
|
||||
/* clean this up */
|
||||
irc_line_init(&l);
|
||||
l.origin = P_IRCMASK;
|
||||
_irc_line_append(&l, "PRIVMSG");
|
||||
_irc_line_append(&l, dest);
|
||||
_irc_line_append(&l, "End of backlog");
|
||||
list_add_last(ret, irc_line_to_string(&l));
|
||||
_irc_line_deinit(&l);
|
||||
/*
|
||||
* This exception is cosmetic, but you want it.
|
||||
* Most of the time, you get backlog from your own nick for
|
||||
* your mode changes only.
|
||||
* Hence opening a query just to say "end of backlog"...
|
||||
*/
|
||||
if (strcmp(bl, cli_nick) != 0) {
|
||||
/* clean this up */
|
||||
irc_line_init(&l);
|
||||
l.origin = P_IRCMASK;
|
||||
if (dest == cli_nick)
|
||||
l.origin = bl;
|
||||
_irc_line_append(&l, "PRIVMSG");
|
||||
_irc_line_append(&l, dest);
|
||||
_irc_line_append(&l, "End of backlog");
|
||||
list_add_last(ret, irc_line_to_string(&l));
|
||||
_irc_line_deinit(&l);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user