]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
stats are per channel instead of global ('PRIVATE') only
[infobot.git] / src / UserExtra.pl
index 12ec9c324a2f6729c5381cf2341b602f9da802c5..6d1223b82ed27d09f12caa1ba8b85f9ddec419bd 100644 (file)
@@ -192,7 +192,7 @@ sub factstats {
 sub karma {
     my $target = lc( shift || $who );
     my $karma  = &sqlSelect("stats", "counter",
-       { nick => $target, type => "karma" }) || 0;
+       { nick => $target, type => "karma", channel => $chan }) || 0;
 
     if ($karma != 0) {
        &performStrictReply("$target has karma of $karma");
@@ -442,26 +442,13 @@ sub userCommands {
     }
 
     # crypt.
-    if ($message =~ /^crypt(\s+(.*))?$/i) {
-       my @args        = split /\s+/, $2;
-
-       if (!scalar @args or scalar @args > 2) {
-           &help("crypt");
-           return;
-       }
-
-       if (scalar @args == 2) {
-# disable cause $1$ will use md5
-#          if (length $args[0] != 2) {
-#              &msg($who, "invalid format...");
-#              return;
-#          }
-
-           &performStrictReply( crypt($args[1], $args[0]) );
+    if ($message =~ /^crypt\s+(\S*)?\s*(.*)?$/i) {
+&status("crypt: $1:$2:$3");
+       if ("$2" ne '') {
+           &performStrictReply(crypt($2, $1));
        } else {
-           &performStrictReply( &mkcrypt($args[0]) );
+           &performStrictReply(&mkcrypt($1));
        }
-
        return;
     }