]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/u_listmode.h
Update copyrights for 2009.
[user/henk/code/inspircd.git] / include / u_listmode.h
index 69ee4f668db7cc20097bea1b1758fca4853cc034..97a6243e57ccba8b9ee1e8ffa44b351ca1e15a5f 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
 
 /** Get the time as a string
  */
-inline std::string stringtime()
+inline std::string stringtime(InspIRCd* Instance)
 {
        std::ostringstream TIME;
-       TIME << time(NULL); 
+       TIME << Instance->Time(); 
        return TIME.str();
 }
 
@@ -44,10 +44,10 @@ public:
 
 /** Items stored in the channel's list
  */
-typedef std::vector<ListItem> modelist;
+typedef std::list<ListItem> modelist;
 /** Max items per channel by name
  */
-typedef std::vector<ListLimit> limitlist;
+typedef std::list<ListLimit> limitlist;
 
 /** A request used to check if a user is on a channel's list or not
  */
@@ -178,7 +178,7 @@ class ListModeBase : public ModeHandler
                {
                        for (modelist::reverse_iterator it = el->rbegin(); it != el->rend(); ++it)
                        {
-                               user->WriteNumeric(listnumeric, "%s %s %s %s %s", user->nick.c_str(), channel->name.c_str(), it->mask.c_str(), it->nick.c_str(), it->time.c_str());
+                               user->WriteNumeric(listnumeric, "%s %s %s %s %s", user->nick.c_str(), channel->name.c_str(), it->mask.c_str(), (it->nick.length() ? it->nick.c_str() : ServerInstance->Config->ServerName), it->time.c_str());
                        }
                }
                user->WriteNumeric(endoflistnumeric, "%s %s :%s", user->nick.c_str(), channel->name.c_str(), endofliststring.c_str());
@@ -331,7 +331,7 @@ class ListModeBase : public ModeHandler
                                                        ListItem e;
                                                        e.mask = parameter;
                                                        e.nick = servermode ? ServerInstance->Config->ServerName : source->nick;
-                                                       e.time = stringtime();
+                                                       e.time = stringtime(ServerInstance);
 
                                                        el->push_back(e);
                                                        return MODEACTION_ALLOW;