summaryrefslogtreecommitdiff
path: root/src/irc/irc_channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/irc/irc_channel.cpp')
-rw-r--r--src/irc/irc_channel.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/irc/irc_channel.cpp b/src/irc/irc_channel.cpp
new file mode 100644
index 0000000..223305b
--- /dev/null
+++ b/src/irc/irc_channel.cpp
@@ -0,0 +1,24 @@
+#include <irc/irc_channel.hpp>
+#include <utils/make_unique.hpp>
+
+IrcChannel::IrcChannel():
+ joined(false),
+ self(nullptr)
+{
+}
+
+void IrcChannel::set_self(const std::string& name)
+{
+ this->self = std::make_unique<IrcUser>(name);
+}
+
+IrcUser* IrcChannel::add_user(const std::string& name)
+{
+ this->users.emplace_back(std::make_unique<IrcUser>(name));
+ return this->users.back().get();
+}
+
+IrcUser* IrcChannel::get_self() const
+{
+ return this->self.get();
+}