diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index 2cfde2c..c04fdd1 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -67,7 +67,7 @@ public static function readUserData($field) { if ($data[WCF::getUser()->userID] === null) { switch ($field) { case 'color': - $data[WCF::getUser()->userID] = array(1 => 0xFF0000, 2 => 0x00FF00); + $data[WCF::getUser()->userID] = array(1 => self::getRandomNumber(), 2 => self::getRandomNumber() * 0xFFFF); break; } static::writeUserData(array($field => $data[WCF::getUser()->userID])); @@ -79,6 +79,16 @@ public static function readUserData($field) { else return $data[WCF::getUser()->userID]; } + /** + * Returns a random number. + * + * @return integer + */ + public static /* int */ getRandomNumber() { + return 4; // chosen by a fair dice roll + // guaranteed to be random + } + /** * Writes user data *