summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-06-12 18:41:48 +0100
committerPeter Powell <petpow@saberuk.com>2019-06-12 18:43:00 +0100
commit938837af9fe92d0fef811db96a5e9d6bf8e3ae11 (patch)
treea3bb8943b99776ccf74e499087ab36c21cf75660
parent9b35c4c78cb15bdae0431f1425983bc41150fee5 (diff)
chanhistory: recreate the mode parameter instead of saving it.
-rw-r--r--src/modules/m_chanhistory.cpp18
1 files changed, 11 insertions, 7 deletions
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<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));
}
};