summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/hashcomp.h7
-rw-r--r--src/hashcomp.cpp14
-rw-r--r--src/modules/m_cban.cpp7
3 files changed, 23 insertions, 5 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 8e077a732..3aa838da2 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -129,4 +129,11 @@ namespace irc
typedef basic_string<char, irc_char_traits, allocator<char> > string;
}
+/* Define operators for using >> and << with irc::string to an ostream on an istream. */
+/* This was endless fun. No. Really. */
+/* It was also the first core change Ommeh made, if anyone cares */
+
+std::ostream& operator<<(std::ostream &os, const irc::string &str);
+std::istream& operator>>(std::istream &is, irc::string &str);
+
#endif
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 150bf77fe..652618a79 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -148,3 +148,17 @@ const char* irc::irc_char_traits::find(const char* s1, int n, char c)
s1++;
return s1;
}
+
+/* See hashcomp.h if you care about these... */
+std::ostream& operator<<(std::ostream &os, const irc::string &str)
+{
+ return os << str.c_str();
+}
+
+std::istream& operator>>(std::istream &is, irc::string &str)
+{
+ std::string tmp;
+ is >> tmp;
+ str = tmp.c_str();
+ return is;
+}
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index 8739fc98c..df0bd1d4d 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -199,7 +199,7 @@ class ModuleCBan : public Module
virtual Version GetVersion()
{
- return Version(1,0,0,0,VF_VENDOR);
+ return Version(1,0,0,1,VF_VENDOR);
}
};
@@ -214,14 +214,11 @@ CBan DecodeCBan(const std::string &data)
{
CBan res;
std::istringstream stream;
- // XXX - Change this...we shouldn't need tempname, need an overloaded iostream operator on irc::string?
- std::string tempname;
- stream >> tempname;
+ stream >> res.chname;
stream >> res.set_by;
stream >> res.set_on;
stream >> res.length;
res.reason = stream.str();
- res.chname = tempname.c_str();
return res;
}