From 3079c38d2d6ad418d2591cc7f910c588dfebd279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 18 May 2017 16:00:32 +0200 Subject: 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 --- src/irc/irc_channel.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/irc/irc_channel.hpp') 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& prefix_to_mode); @@ -38,7 +38,8 @@ public: { return this->users; } protected: - std::unique_ptr self{}; + // Pointer to one IrcUser stored in users + IrcUser* self{nullptr}; std::vector> users{}; }; -- cgit v1.2.3