]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_ison.cpp
Dunno why this method was static, doesnt need to be...
[user/henk/code/inspircd.git] / src / cmd_ison.cpp
index f89b549ca874749a3df3b17f83a4083193c50b70..c76bf40e101c8a9c6073150ad729efa2af9119ca 100644 (file)
  * ---------------------------------------------------
  */
 
-#include "users.h"
 #include "inspircd.h"
+#include "users.h"
 #include "commands/cmd_ison.h"
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_ison(Instance);
 }
@@ -44,6 +44,38 @@ CmdResult cmd_ison::Handle (const char** parameters, int pcnt, userrec *user)
                        }
                        ison_already[u] = u;
                }
+               else
+               {
+                       if ((i == pcnt-1) && (strchr(parameters[i],' ')))
+                       {
+                               /* Its a space seperated list of nicks (RFC1459 says to support this)
+                                */
+                               irc::spacesepstream list(parameters[i]);
+                               std::string item = "*";
+                               while (((item = list.GetToken()) != ""))
+                               {
+                                       u = ServerInstance->FindNick(item);
+                                       if (ison_already.find(u) != ison_already.end())
+                                               continue;
+
+                                       if (u)
+                                       {
+                                               if (u->Visibility && !u->Visibility->VisibleTo(user))
+                                                       continue;
+
+                                               reply.append(u->nick).append(" ");
+                                               if (reply.length() > 450)
+                                               {
+                                                       user->WriteServ(reply);
+                                                       reply = std::string("303 ") + user->nick + " :";
+                                               }
+                                               ison_already[u] = u;
+                                       }
+                               }
+                       }
+                       /* There will only be one of these, we can bail after. */
+                       break;
+               }
        }
 
        if (!reply.empty())