]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
Check for windows drive letters on the start of paths and treat them the same as...
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index ac0b5affbafdc9ae6bca9ce9e811539fb31e5950..ddb6f26670eabdb085101613c76de437213f5fe0 100644 (file)
@@ -110,7 +110,7 @@ class CommandSVSWatch : public Command
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
 
-       CmdResult Handle (const char* const* parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
                if (!ServerInstance->ULine(user->server))
                        return CMD_FAILURE;
@@ -121,7 +121,7 @@ class CommandSVSWatch : public Command
                        
                if (IS_LOCAL(u))
                {
-                       ServerInstance->Parser->CallHandler("WATCH", &parameters[1], 1, u);
+                       ServerInstance->Parser->CallHandler("WATCH", parameters, u);
                }
                
                return CMD_SUCCESS;
@@ -241,7 +241,7 @@ class CommandWatch : public Command
                                user->WriteNumeric(604, "%s %s %s :is online",user->nick, nick, (*wl)[nick].c_str());
                                if (IS_AWAY(target))
                                {
-                                       user->WriteNumeric(609, "%s %s %s %s %ld :is away", user->nick, target->nick, target->ident, target->dhost, target->awaytime);
+                                       user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick, target->nick, target->ident, target->dhost, (unsigned long) target->awaytime);
                                }
                        }
                        else
@@ -261,9 +261,9 @@ class CommandWatch : public Command
                TRANSLATE2(TR_TEXT, TR_END); /* we watch for a nick. not a UID. */
        }
 
-       CmdResult Handle (const char* const* parameters, int pcnt, User *user)
+       CmdResult Handle (const std::vector<std::string> &parameters, User *user)
        {
-               if (!pcnt)
+               if (!parameters.size())
                {
                        watchlist* wl;
                        if (user->GetExt("watchlist", wl))
@@ -276,11 +276,11 @@ class CommandWatch : public Command
                        }
                        user->WriteNumeric(607, "%s :End of WATCH list",user->nick);
                }
-               else if (pcnt > 0)
+               else if (parameters.size() > 0)
                {
-                       for (int x = 0; x < pcnt; x++)
+                       for (int x = 0; x < (int)parameters.size(); x++)
                        {
-                               const char *nick = parameters[x];
+                               const char *nick = parameters[x].c_str();
                                if (!strcasecmp(nick,"C"))
                                {
                                        // watch clear
@@ -320,7 +320,7 @@ class CommandWatch : public Command
                                                                User *targ = ServerInstance->FindNick(q->first.c_str());
                                                                if (IS_AWAY(targ))
                                                                {
-                                                                       user->WriteNumeric(609, "%s %s %s %s %ld :is away", user->nick, targ->nick, targ->ident, targ->dhost, targ->awaytime);
+                                                                       user->WriteNumeric(609, "%s %s %s %s %lu :is away", user->nick, targ->nick, targ->ident, targ->dhost, (unsigned long) targ->awaytime);
                                                                }
                                                        }
                                                        else
@@ -433,7 +433,7 @@ class Modulewatch : public Module
                        for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
                        {
                                if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                       (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick ,user->nick, user->ident, user->dhost, ServerInstance->Time());
+                                       (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick ,user->nick, user->ident, user->dhost, (unsigned long) ServerInstance->Time());
 
                                watchlist* wl;
                                if ((*n)->GetExt("watchlist", wl))
@@ -503,7 +503,7 @@ class Modulewatch : public Module
                        for (std::deque<User*>::iterator n = x->second.begin(); n != x->second.end(); n++)
                        {
                                if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                       (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick, user->nick, user->ident, user->dhost, user->age);
+                                       (*n)->WriteNumeric(600, "%s %s %s %s %lu :arrived online", (*n)->nick, user->nick, user->ident, user->dhost, (unsigned long) user->age);
 
                                watchlist* wl;
                                if ((*n)->GetExt("watchlist", wl))
@@ -526,7 +526,7 @@ class Modulewatch : public Module
                                if ((*n)->GetExt("watchlist", wl))
                                {
                                        if (!user->Visibility || user->Visibility->VisibleTo(user))
-                                               (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, user->age);
+                                               (*n)->WriteNumeric(601, "%s %s %s %s %lu :went offline", (*n)->nick, oldnick.c_str(), user->ident, user->dhost, (unsigned long) user->age);
                                        (*wl)[oldnick.c_str()] = "";
                                }
                        }