fixed last commit
[NeonServV5.git] / modcmd.c
index 33e628459ae4615b9fdf414a25d12934a273eed9..7c1b0c5ec9a0f7b38afe0c8583143249e81c2c6e 100644 (file)
--- a/modcmd.c
+++ b/modcmd.c
@@ -87,12 +87,12 @@ static char* get_channel_trigger(int botid, struct ChanNode *chan) {
     return trigger->trigger;
 }
 
-static void handle_command_async(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct ChanNode *sent_chan struct cmd_binding *cbind, char **argv, int argc);
+static void handle_command_async(struct ClientSocket *client, struct UserNode *user, struct ChanNode *chan, struct ChanNode *sent_chan, struct cmd_binding *cbind, char **argv, int argc);
 
 static USERAUTH_CALLBACK(command_checked_auth) {
     struct command_check_user_cache *cache = data;
     tmp_text_client = cache->textclient;
-    handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc)
+    handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc);
     free(cache->message);
     free(cache);
 }
@@ -269,7 +269,8 @@ static void handle_command_async(struct ClientSocket *client, struct UserNode *u
         if(str_b) {
             while((str_a = strstr(str_b, ","))) {
                 *str_a = '\0';
-                if(*str_b[0] == '#') {
+                if(*str_b == '#') {
+                    str_b++;
                     access_pos += sprintf(access_list+access_pos, ", `%s`", str_b);
                     access_count++;
                 } else {
@@ -279,8 +280,13 @@ static void handle_command_async(struct ClientSocket *client, struct UserNode *u
                 *str_a = ',';
                 str_b = str_a+1;
             }
-            access_pos += sprintf(access_list+access_pos, ", `%s`", str_b);
-            access_count++;
+            if(*str_b == '#') {
+                str_b++;
+                access_pos += sprintf(access_list+access_pos, ", `%s`", str_b);
+                access_count++;
+            } else if(atoi(str_b) > minaccess)
+                minaccess = atoi(str_b);
+                
         } else
             access_list[0] = '\0';
         if(!(chan->flags & CHANFLAG_REQUESTED_CHANINFO) || (sent_chan && sent_chan == chan) || access_count || minaccess) {