[project @ 2005-07-04 01:48:38 by unknown_lamer]
[clinton/bobotpp.git] / source / UserCommands.C
index 7e4685d..527f37e 100644 (file)
@@ -14,7 +14,7 @@
 
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -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