From cd9ac916de059bb0ed8fadfa33c5c418db1619c0 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Mon, 24 May 2021 09:48:57 +0200 Subject: [PATCH] Allow setting set::history::channel::playback-on-join::lines to zero in case you want to disable this feature. Note that clients that are using CHATHISTORY will already no longer receive history-on-join ("push") since they REQ a CAP that will inhibit this and they will "pull" the history instead when they want/need to. So... this option is really only there if you want to disable it for non-CHATHISTORY-clients. --- src/modules/chanmodes/history.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/chanmodes/history.c b/src/modules/chanmodes/history.c index 5790e2467..124a25ebc 100644 --- a/src/modules/chanmodes/history.c +++ b/src/modules/chanmodes/history.c @@ -152,9 +152,9 @@ int history_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) int v; CheckNull(cep4); v = atoi(cep4->ce_vardata); - if ((v < 1) || (v > 1000000000)) + if ((v < 0) || (v > 1000)) { - config_error("%s:%i: set::history::channel::playback-on-join::lines must be between 1 and 1000. " + config_error("%s:%i: set::history::channel::playback-on-join::lines must be between 0 and 1000. " "Recommended values are 10-50. Got: %d.", cep4->ce_fileptr->cf_filename, cep4->ce_varlinenum, v); errors++; @@ -167,9 +167,9 @@ int history_config_test(ConfigFile *cf, ConfigEntry *ce, int type, int *errs) long v; CheckNull(cep4); v = config_checkval(cep4->ce_vardata, CFG_TIME); - if (v < 1) + if (v < 0) { - config_error("%s:%i: set::history::channel::playback-on-join::time must be a positive number.", + config_error("%s:%i: set::history::channel::playback-on-join::time must be zero or more.", cep4->ce_fileptr->cf_filename, cep4->ce_varlinenum); errors++; continue; @@ -683,7 +683,7 @@ int history_chanmsg(Client *client, Channel *channel, int sendflags, int prefix, int history_join(Client *client, Channel *channel, MessageTag *mtags, char *parv[]) { /* Only for +H channels */ - if (!HistoryEnabled(channel)) + if (!HistoryEnabled(channel) || !cfg.playback_on_join.lines || !cfg.playback_on_join.time) return 0; /* No history-on-join for clients that implement CHATHISTORY,