mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Don't color usernames if the color has not been set explicitly
This commit is contained in:
parent
c44dea73d3
commit
2ad26f0d04
@ -124,8 +124,13 @@ public function getUsername($colored = false) {
|
||||
if ($this->type == self::TYPE_INFORMATION) return WCF::getLanguage()->get('chat.global.information');
|
||||
|
||||
if ($colored) {
|
||||
if ($this->color1 !== null || $this->color2 !== null) {
|
||||
$username = \chat\util\ChatUtil::gradient($username, $this->color1, $this->color2);
|
||||
}
|
||||
else {
|
||||
$username = '<span class="defaultColor">'.$username.'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
return $username;
|
||||
}
|
||||
|
@ -32,8 +32,8 @@ public function __construct(\chat\system\command\CommandHandler $commandHandler)
|
||||
|
||||
$editor = new \wcf\data\user\UserEditor($this->user);
|
||||
$editor->update(array(
|
||||
'chatColor1' => 0,
|
||||
'chatColor2' => 0
|
||||
'chatColor1' => null,
|
||||
'chatColor2' => null
|
||||
));
|
||||
$this->didInit();
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ CREATE TABLE chat1_message (
|
||||
message MEDIUMTEXT NOT NULL,
|
||||
enableSmilies TINYINT(1) NOT NULL DEFAULT 1,
|
||||
enableHTML TINYINT(1) NOT NULL DEFAULT 0,
|
||||
color1 INT(10) NOT NULL DEFAULT 0,
|
||||
color2 INT(10) NOT NULL DEFAULT 0,
|
||||
color1 INT(10) DEFAULT NULL,
|
||||
color2 INT(10) DEFAULT NULL,
|
||||
additionalData TEXT DEFAULT NULL,
|
||||
attachmentID INT(10) DEFAULT NULL,
|
||||
|
||||
@ -62,8 +62,8 @@ CREATE TABLE chat1_suspension (
|
||||
);
|
||||
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatRoomID INT(10) DEFAULT NULL;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatColor1 INT(10) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatColor2 INT(10) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatColor1 INT(10) DEFAULT NULL;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatColor2 INT(10) DEFAULT NULL;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatLastActivity INT(10) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatAway TEXT DEFAULT NULL;
|
||||
ALTER TABLE wcf1_user ADD COLUMN chatLastSeen INT(10) NOT NULL DEFAULT 0;
|
||||
|
Loading…
Reference in New Issue
Block a user