summaryrefslogtreecommitdiff
path: root/src/irc/irc_channel.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-05-18 16:00:32 +0200
committerlouiz’ <louiz@louiz.org>2017-05-18 16:12:10 +0200
commit3079c38d2d6ad418d2591cc7f910c588dfebd279 (patch)
tree8d4a68c6c3f0e3b0a6932cc5ae96e20a8ca754b5 /src/irc/irc_channel.hpp
parentbb150d587f080af38a74f2420457f1e0b2606a62 (diff)
downloadbiboumi-3079c38d2d6ad418d2591cc7f910c588dfebd279.tar.gz
biboumi-3079c38d2d6ad418d2591cc7f910c588dfebd279.tar.bz2
biboumi-3079c38d2d6ad418d2591cc7f910c588dfebd279.tar.xz
biboumi-3079c38d2d6ad418d2591cc7f910c588dfebd279.zip
Refactor the channel::self to point at the existing user
This way, the user is always up to date, instead of being a duplicate out of sync. fix #3258
Diffstat (limited to 'src/irc/irc_channel.hpp')
-rw-r--r--src/irc/irc_channel.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/irc/irc_channel.hpp b/src/irc/irc_channel.hpp
index 7c269b9..8f85edb 100644
--- a/src/irc/irc_channel.hpp
+++ b/src/irc/irc_channel.hpp
@@ -27,7 +27,7 @@ public:
bool parting{false};
std::string topic{};
std::string topic_author{};
- void set_self(const std::string& name);
+ void set_self(IrcUser* user);
IrcUser* get_self() const;
IrcUser* add_user(const std::string& name,
const std::map<char, char>& prefix_to_mode);
@@ -38,7 +38,8 @@ public:
{ return this->users; }
protected:
- std::unique_ptr<IrcUser> self{};
+ // Pointer to one IrcUser stored in users
+ IrcUser* self{nullptr};
std::vector<std::unique_ptr<IrcUser>> users{};
};