commit 4b0f888f0c4b802051ceaff3cb1b6606972617be
parent 1b18070b6af118ec82dd29e9c1ba40a0a1ba0f63
Author: hhvn <dev@hhvn.uk>
Date: Wed, 8 Dec 2021 17:57:09 +0000
ui.c hist.c hirc.h: specify options to purge
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hirc.h b/hirc.h
@@ -69,7 +69,7 @@ struct History *hist_format(struct HistInfo *history, enum Activity activity,
enum HistOpt options, char *format, ...);
int hist_len(struct History **history);
int hist_log(char *msg, struct Nick *from, time_t timestamp, struct Server *server);
-void hist_purgetmp(struct HistInfo *histinfo);
+void hist_purgeopt(struct HistInfo *histinfo, enum HistOpt options);
/* serv.c */
void serv_free(struct Server *server);
diff --git a/hist.c b/hist.c
@@ -118,7 +118,7 @@ hist_add(struct HistInfo *histinfo, struct Nick *from,
}
void
-hist_purgetmp(struct HistInfo *histinfo) {
+hist_purgeopt(struct HistInfo *histinfo, enum HistOpt options) {
struct History *p, *next;
if (!histinfo)
@@ -128,7 +128,7 @@ hist_purgetmp(struct HistInfo *histinfo) {
for (; p; p = next) {
next = p->next;
- if (p->options & HIST_TMP) {
+ if (p->options & options) {
if (p->prev)
p->prev->next = p->next;
else
diff --git a/ui.c b/ui.c
@@ -987,7 +987,7 @@ ui_select(struct Server *server, struct Channel *channel) {
selected.history = channel ? channel->history : server ? server->history : main_buf;
selected.name = channel ? channel->name : server ? server->name : "hirc";
- hist_purgetmp(selected.history);
+ hist_purgeopt(selected.history, HIST_TMP);
}
static char *