From 938837af9fe92d0fef811db96a5e9d6bf8e3ae11 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 12 Jun 2019 18:41:48 +0100 Subject: chanhistory: recreate the mode parameter instead of saving it. --- src/modules/m_chanhistory.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_chanhistory.cpp b/src/modules/m_chanhistory.cpp index 540fa2908..ed7bb684f 100644 --- a/src/modules/m_chanhistory.cpp +++ b/src/modules/m_chanhistory.cpp @@ -39,11 +39,14 @@ struct HistoryItem struct HistoryList { std::deque 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 > @@ -90,18 +93,19 @@ class HistoryMode : public ParamMode > 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)); } }; -- cgit v1.2.3