inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit 938837af9fe92d0fef811db96a5e9d6bf8e3ae11
parent 9b35c4c78cb15bdae0431f1425983bc41150fee5
Author: Peter Powell <petpow@saberuk.com>
Date:   Wed, 12 Jun 2019 18:41:48 +0100

chanhistory: recreate the mode parameter instead of saving it.

Diffstat:
Msrc/modules/m_chanhistory.cpp | 18+++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp @@ -39,11 +39,14 @@ struct HistoryItem struct HistoryList { std::deque<HistoryItem> lines; - unsigned int maxlen, maxtime; - std::string param; + unsigned int maxlen; + unsigned int maxtime; - HistoryList(unsigned int len, unsigned int time, const std::string& oparam) - : maxlen(len), maxtime(time), param(oparam) { } + HistoryList(unsigned int len, unsigned int time) + : maxlen(len) + , maxtime(time) + { + } }; class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> > @@ -90,18 +93,19 @@ class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> > history->maxlen = len; history->maxtime = time; - history->param = parameter; } else { - ext.set(channel, new HistoryList(len, time, parameter)); + ext.set(channel, new HistoryList(len, time)); } return MODEACTION_ALLOW; } void SerializeParam(Channel* chan, const HistoryList* history, std::string& out) { - out.append(history->param); + out.append(ConvToStr(history->maxlen)); + out.append(":"); + out.append(InspIRCd::DurationString(history->maxtime)); } };