summaryrefslogtreecommitdiff
path: root/src/modules/m_cban.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_cban.cpp')
-rw-r--r--src/modules/m_cban.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 04a99674d..3b6c4eccd 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -202,20 +202,19 @@ class ModuleCBan : public Module
std::string EncodeCBan(const CBan &ban)
{
std::ostringstream stream;
- stream << ban.chname << " " << ban.set_by << " " << ban.set_on << " " << ban.length << " " << ban.reason;
- return stream.str();
+ stream << ban.chname << " " << ban.set_by << " " << ban.set_on << " " << ban.length << " :" << ban.reason;
+ return stream.str();
}
CBan DecodeCBan(const std::string &data)
{
CBan res;
- std::istringstream stream(data);
- stream >> res.chname;
- stream >> res.set_by;
- stream >> res.set_on;
- stream >> res.length;
- res.reason = stream.str();
-
+ irc::tokenstream tokens(data);
+ tokens.GetToken(res.chname);
+ tokens.GetToken(res.set_by);
+ tokens.GetToken(res.set_on);
+ tokens.GetToken(res.length);
+ tokens.GetToken(res.reason);
return res;
}