]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
core_whowas Store the nickname in WhoWas::Nick
authorAttila Molnar <attilamolnar@hush.com>
Wed, 9 Jul 2014 13:06:52 +0000 (15:06 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 9 Jul 2014 13:06:52 +0000 (15:06 +0200)
include/commands/cmd_whowas.h
src/coremods/core_whowas.cpp

index 5993500f66438a0434ed7c78d2e05404d41a2a10..5c2bb62ee881b056655df6c31924d4f281257400 100644 (file)
@@ -44,9 +44,13 @@ namespace WhoWas
                 */
                const time_t addtime;
 
+               /** Nickname whose information is stored in this class
+                */
+               const irc::string nick;
+
                /** Constructor to initialize fields
                 */
-               Nick();
+               Nick(const irc::string& nickname);
 
                /** Destructor, deallocates all elements in the entries container
                 */
index 4308195ecf6d2ac59c33dde2092d1486dff4e3e2..53b25eb7ca8e04358e588372b669cc9e85ada5c6 100644 (file)
@@ -104,7 +104,7 @@ void CommandWhowas::AddToWhoWas(User* user)
        if (ret.second) // If inserted
        {
                // This nick is new, create a list for it and add the first record to it
-               WhoWas::Nick* nick = new WhoWas::Nick;
+               WhoWas::Nick* nick = new WhoWas::Nick(ret.first->first);
                nick->entries.push_back(new WhoWasGroup(user));
                ret.first->second = nick;
 
@@ -209,8 +209,9 @@ WhoWasGroup::WhoWasGroup(User* user) : host(user->host), dhost(user->dhost), ide
 {
 }
 
-WhoWas::Nick::Nick()
+WhoWas::Nick::Nick(const irc::string& nickname)
        : addtime(ServerInstance->Time())
+       , nick(nickname)
 {
 }