From d1a44417e6da06ac9302a1ef05f9f82cd285a25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 3 Mar 2014 03:25:37 +0100 Subject: [PATCH] Properly set $userID as key in Room::getUsers() NewMessagesPage relies on the keys being userIDs for user storage loading. --- file/lib/data/room/Room.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file/lib/data/room/Room.class.php b/file/lib/data/room/Room.class.php index 67e0803..deccce5 100644 --- a/file/lib/data/room/Room.class.php +++ b/file/lib/data/room/Room.class.php @@ -179,9 +179,9 @@ public function getUsers() { $userList->readObjects(); $users = $userList->getObjects(); - foreach ($users as $user) { + foreach ($users as $userID => $user) { if (!isset(self::$users[$user->chatRoomID])) self::$users[$user->chatRoomID] = array(); - self::$users[$user->chatRoomID][] = $user; + self::$users[$user->chatRoomID][$userID] = $user; } } if (!isset(self::$users[$this->roomID])) self::$users[$this->roomID] = array();