]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_who.cpp
Fix for parameters which contain a colon (which is not the first char in the string)
[user/henk/code/inspircd.git] / src / cmd_who.cpp
index 16e746ee30c5f3c73435b8678f7f1fc158cc7685..5ab54dc02b7a9d28797611316901b7bc9b71520d 100644 (file)
 #include "configreader.h"
 #include "users.h"
 #include "modules.h"
-#include "commands.h"
-#include "helperfuncs.h"
 #include "wildcard.h"
 #include "commands/cmd_who.h"
 
-
-
 /* get the last 'visible' chan of a user */
 static char *getlastchanname(userrec *u)
 {
@@ -46,6 +42,9 @@ bool whomatch(userrec* user, const char* matchtext, bool opt_realname, bool opt_
        bool realhost = false;
        bool realname = false;
 
+       if (user->registered != REG_ALL)
+               return false;
+
        if (opt_realname)
                realname = match(user->fullname, matchtext);
 
@@ -147,7 +146,7 @@ void cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
                                wholine.append("*");
                        }
 
-                       wholine = wholine + ch->GetStatusChar(i->second) + " :0 " + i->second->fullname;
+                       wholine = wholine + ch->GetPrefixChar(i->second) + " :0 " + i->second->fullname;
                        whoresults.push_back(wholine);
                }
        }
@@ -185,7 +184,7 @@ void cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
                                                wholine.append("*");
                                        }
        
-                                       wholine = wholine + ch->GetStatusChar(oper) + " :0 " + oper->fullname;
+                                       wholine = wholine + ch->GetPrefixChar(oper) + " :0 " + oper->fullname;
                                        whoresults.push_back(wholine);
                                }
                        }
@@ -217,7 +216,7 @@ void cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
                                                wholine.append("*");
                                        }
 
-                                       wholine = wholine + ch->GetStatusChar(i->second) + " :0 " + i->second->fullname;
+                                       wholine = wholine + ch->GetPrefixChar(i->second) + " :0 " + i->second->fullname;
                                        whoresults.push_back(wholine);
                                }
                        }
@@ -228,7 +227,7 @@ void cmd_who::Handle (const char** parameters, int pcnt, userrec *user)
        {
                for (std::vector<std::string>::const_iterator n = whoresults.begin(); n != whoresults.end(); n++)
                        user->WriteServ(*n);
-               user->WriteServ("315 %s %s :End of /WHO list.",user->nick, parameters[0]);
+               user->WriteServ("315 %s %s :End of /WHO list.",user->nick, *parameters[0] ? parameters[0] : "*");
        }
        else
        {