fixed parsing of PART raws
authorpk910 <philipp@zoelle1.de>
Wed, 21 Sep 2011 13:48:48 +0000 (15:48 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 21 Sep 2011 13:48:48 +0000 (15:48 +0200)
IRCParser.c

index 626c51ddf8198b85b2d3d76538ca824a68bd27e6..60ba4efc10efbcf99c2e7686632bd82856d6629c 100644 (file)
@@ -125,7 +125,7 @@ static IRC_CMD(raw_join) {
 }
 
 static IRC_CMD(raw_part) {
-    if(from == NULL || argc < 2) return 0;
+    if(from == NULL || argc < 1) return 0;
     struct UserNode *user = getUserByMask(from);
     if(user == NULL) return 0;
     struct ChanNode *chan = getChanByName(argv[0]);
@@ -133,7 +133,7 @@ static IRC_CMD(raw_part) {
     if(isUserOnChan(user, chan) && (chan->flags & CHANFLAG_RECEIVED_USERLIST)) {
         struct ChanUser *chanuser = getChanUser(user, chan);
         delChanUser(chanuser, 0); //we need to free the chanuser manually!
-        event_part(chanuser, argv[1]);
+        event_part(chanuser, (argc > 1 ? argv[1] : NULL));
         free(chanuser);
         if(chan->chanbot == user) {
             //check if theres another bot in the channel - otherwise free it