[project @ 2005-07-04 01:48:38 by unknown_lamer]
[clinton/bobotpp.git] / source / UserCommands.C
index 2ba0cc9..527f37e 100644 (file)
@@ -582,16 +582,24 @@ UserCommands::Help(ServerConnection *cnx, Person *from,
     int level = Utils::get_level(cnx->bot, from->getAddress());
     String result = "";
     int length = 0;
-    std::map<std::string, class userFunction*, std::less<std::string> >::iterator it;
-    for (it = cnx->bot->userFunctions.begin(); it != cnx->bot->userFunctions.end(); ++it)
-      if ((*it).second->minLevel <= level) {
-        result = result + (*it).first + " ";
-        length += (*it).first.length() + 1;
-        if (length >= 256) {
-          from->sendNotice(result);
-          result = ""; length = 0;
-        }
-    }
+    std::map<std::string, class userFunction*, 
+      std::less<std::string> >::iterator it;
+
+    for (it = cnx->bot->userFunctions.begin(); 
+        it != cnx->bot->userFunctions.end(); ++it)
+      {
+       if ((*it).second->minLevel <= level) 
+         {
+           result = result + (*it).first + " ";
+           length += (*it).first.length() + 1;
+
+           if (length >= 256) 
+             {
+               from->sendNotice(result);
+               result = ""; length = 0;
+             }
+         }
+      }
     if (result != "")
       from->sendNotice(result);
     from->sendNotice("\002Use\002 HELP <command> \002for"
@@ -935,7 +943,7 @@ UserCommands::Nick(ServerConnection *cnx, Person *from,
     return;
   }
 
-  if (!Utils::valid_nickname_p(nick)) {
+  if (!Utils::valid_nickname_p (cnx->bot, nick)) {
     from->sendNotice(String("\002") + nick +
                      " is not a valid nickname\002");
     return;
@@ -1187,8 +1195,11 @@ UserCommands::SetVersion(ServerConnection *cnx, Person *from,
                          String channel, String rest)
 {
   Message m = Commands::SetVersion(cnx->bot, rest);
+
   if (m.getCode() < 0)
-    from->sendNotice(m.getMessage());
+    {
+      Commands::Notice (cnx->bot, from->getNick (), m.getMessage());
+    }
 }
 
 void