Accept new NOT_READY command format
authorunc0rr
Mon, 23 Feb 2009 18:56:48 +0000
changeset 1829 0cd14c9b1fe0
parent 1828 ba91a89f449a
child 1830 b3e9ab82c364
Accept new NOT_READY command format
QTfrontend/newnetclient.cpp
--- a/QTfrontend/newnetclient.cpp	Mon Feb 23 18:41:16 2009 +0000
+++ b/QTfrontend/newnetclient.cpp	Mon Feb 23 18:56:48 2009 +0000
@@ -288,26 +288,32 @@
 	}
 
 	if (lst[0] == "READY") {
-		if(lst.size() != 2)
+		if(lst.size() < 2)
 		{
 			qWarning("Net: Malformed READY message");
 			return;
 		}
-		emit setReadyStatus(lst[1], true);
-		if (lst[1] == mynick)
-			emit setMyReadyStatus(true);
+		for(int i = 1; i < lst.size(); ++i)
+		{
+			if (lst[i] == mynick)
+				emit setMyReadyStatus(true);
+			emit setReadyStatus(lst[i], true);
+		}
 		return;
 	}
 	
 	if (lst[0] == "NOT_READY") {
-		if(lst.size() != 2)
+		if(lst.size() < 2)
 		{
 			qWarning("Net: Malformed NOT_READY message");
 			return;
 		}
-		emit setReadyStatus(lst[1], false);
-		if (lst[1] == mynick)
-			emit setMyReadyStatus(false);
+		for(int i = 1; i < lst.size(); ++i)
+		{
+			if (lst[i] == mynick)
+				emit setMyReadyStatus(false);
+			emit setReadyStatus(lst[i], false);
+		}
 		return;
 	}