summaryrefslogtreecommitdiff
path: root/src/irc/iid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/iid.cpp')
-rw-r--r--src/irc/iid.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/irc/iid.cpp b/src/irc/iid.cpp
new file mode 100644
index 0000000..ffc8d88
--- /dev/null
+++ b/src/irc/iid.cpp
@@ -0,0 +1,17 @@
+#include <irc/iid.hpp>
+
+Iid::Iid(const std::string& iid)
+{
+ std::string::size_type sep = iid.find("%");
+ if (sep != std::string::npos)
+ {
+ this->chan = iid.substr(0, sep);
+ sep++;
+ }
+ else
+ {
+ this->chan = iid;
+ return;
+ }
+ this->server = iid.substr(sep);
+}