summaryrefslogtreecommitdiff
path: root/src/irc/irc_channel.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-09 23:17:48 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-09 23:17:48 +0100
commit7c671499350e22f8bfba2f72b9827aa5b200f7b0 (patch)
treed6ec9c42c1f605f9c0c333df0afcc4fe2a00b439 /src/irc/irc_channel.cpp
parentf38b31a63ee203e53d1135a87f1b4e9faaf7dd3f (diff)
downloadbiboumi-7c671499350e22f8bfba2f72b9827aa5b200f7b0.tar.gz
biboumi-7c671499350e22f8bfba2f72b9827aa5b200f7b0.tar.bz2
biboumi-7c671499350e22f8bfba2f72b9827aa5b200f7b0.tar.xz
biboumi-7c671499350e22f8bfba2f72b9827aa5b200f7b0.zip
Implement part and join, both ways
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
index 223305b..6daf708 100644
--- a/src/irc/irc_channel.cpp
+++ b/src/irc/irc_channel.cpp
@@ -22,3 +22,27 @@ IrcUser* IrcChannel::get_self() const
{
return this->self.get();
}
+
+IrcUser* IrcChannel::find_user(const std::string& name)
+{
+ IrcUser user(name);
+ for (const auto& u: this->users)
+ {
+ if (u->nick == user.nick)
+ return u.get();
+ }
+ return nullptr;
+}
+
+void IrcChannel::remove_user(const IrcUser* user)
+{
+ for (auto it = this->users.begin(); it != this->users.end(); ++it)
+ {
+ IrcUser* u = it->get();
+ if (u->nick == user->nick)
+ {
+ this->users.erase(it);
+ break ;
+ }
+ }
+}