- if (substr($response, 0, 1) == "2") {
- $_SESSION["room"] = strtok(substr($response, 4), "|");
- return array(TRUE, substr($response, 0, 3));
+ $results = explode ("|", $response);
+ $status_room = array_shift($results);
+ $status = substr($status_room, 0, 3);
+ if (substr($status, 0, 1) == "2") {
+ $room = substr($status_room, 4);
+ array_unshift($results, $room);
+ $room_state=array(
+ "state" => TRUE,
+ "statereply" => $status,
+ "roomname" => $results[ 0],
+ "nunreadmsg" => $results[ 1],
+ "nmessages" => $results[ 2],
+ "rinfopresent" => $results[ 3],
+ "flags" => $results[ 4],
+ "msgidmax" => $results[ 5],
+ "msgidreadmax" => $results[ 6],
+ "ismailroom" => $results[ 7],
+ "isroomaide" => $results[ 8],
+ "nnewmessages" => $results[ 9],
+ "floorid" => $results[10],
+ "viewselected" => $results[11],
+ "defaultview" => $results[12],
+ "istrashcan" => $results[13]);
+
+ $_SESSION["room"] = $room;
+ if (CITADEL_DEBUG_CITPROTO == 1)
+ {
+ echo "<pre>";
+ print_r($room_state);
+ echo "</pre>";
+
+ }
+
+ return $room_state;