[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"))
|
if (irc_line_elem_equals(line, 1, "-bip"))
|
||||||
return adm_bip(bip, ic, line, 1);
|
return adm_bip(bip, ic, line, 1);
|
||||||
|
|
||||||
printf("%d<-\n", LINK(ic)->user->blreset_on_talk);
|
|
||||||
if (LINK(ic)->user->blreset_on_talk)
|
if (LINK(ic)->user->blreset_on_talk)
|
||||||
log_reset_store(LINK(ic)->log, irc_line_elem(line, 1));
|
log_reset_store(LINK(ic)->log, irc_line_elem(line, 1));
|
||||||
return OK_COPY_CLI;
|
return OK_COPY_CLI;
|
||||||
|
10
src/log.c
10
src/log.c
@ -1308,15 +1308,25 @@ list_t *backlog_lines_from_last_mark(log_t *log, const char *bl,
|
|||||||
|
|
||||||
if (log_has_backlog(log, bl)) {
|
if (log_has_backlog(log, bl)) {
|
||||||
ret = log_backread(log, bl, dest);
|
ret = log_backread(log, bl, dest);
|
||||||
|
/*
|
||||||
|
* 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 */
|
/* clean this up */
|
||||||
irc_line_init(&l);
|
irc_line_init(&l);
|
||||||
l.origin = P_IRCMASK;
|
l.origin = P_IRCMASK;
|
||||||
|
if (dest == cli_nick)
|
||||||
|
l.origin = bl;
|
||||||
_irc_line_append(&l, "PRIVMSG");
|
_irc_line_append(&l, "PRIVMSG");
|
||||||
_irc_line_append(&l, dest);
|
_irc_line_append(&l, dest);
|
||||||
_irc_line_append(&l, "End of backlog");
|
_irc_line_append(&l, "End of backlog");
|
||||||
list_add_last(ret, irc_line_to_string(&l));
|
list_add_last(ret, irc_line_to_string(&l));
|
||||||
_irc_line_deinit(&l);
|
_irc_line_deinit(&l);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user