mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-09 00:20:08 +00:00
Kill dead users.
This commit is contained in:
parent
9180a02f30
commit
56c7544045
@ -30,6 +30,31 @@ public function readData() {
|
|||||||
$this->readRoom();
|
$this->readRoom();
|
||||||
$this->readMessages();
|
$this->readMessages();
|
||||||
$this->users = $this->room->getUsers();
|
$this->users = $this->room->getUsers();
|
||||||
|
|
||||||
|
$deadUsers = \wcf\util\ChatUtil::getDiedUsers();
|
||||||
|
foreach ($deadUsers as $deadUser) {
|
||||||
|
if (!$deadUser) continue;
|
||||||
|
|
||||||
|
$user = new \wcf\data\user\User($deadUser['userID']);
|
||||||
|
if (CHAT_DISPLAY_JOIN_LEAVE) {
|
||||||
|
$userData['color'] = \wcf\util\ChatUtil::readUserData('color', $user);
|
||||||
|
|
||||||
|
$messageAction = new chat\message\ChatMessageAction(array(), 'create', array(
|
||||||
|
'data' => array(
|
||||||
|
'roomID' => $deadUser['roomID'],
|
||||||
|
'sender' => $user->userID,
|
||||||
|
'username' => $user->username,
|
||||||
|
'time' => TIME_NOW,
|
||||||
|
'type' => chat\message\ChatMessage::TYPE_LEAVE,
|
||||||
|
'message' => '',
|
||||||
|
'color1' => $userData['color'][1],
|
||||||
|
'color2' => $userData['color'][2]
|
||||||
|
)
|
||||||
|
));
|
||||||
|
$messageAction->executeAction();
|
||||||
|
}
|
||||||
|
\wcf\util\ChatUtil::writeUserData(array('roomID' => null), $user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<packagedescription><![CDATA[Chat for WoltLab Community Framework™]]></packagedescription>
|
<packagedescription><![CDATA[Chat for WoltLab Community Framework™]]></packagedescription>
|
||||||
<standalone>0</standalone>
|
<standalone>0</standalone>
|
||||||
<isunique>1</isunique>
|
<isunique>1</isunique>
|
||||||
<version>3.0.0 Alpha 11</version>
|
<version>3.0.0 Alpha 12</version>
|
||||||
<date>2011-11-26</date>
|
<date>2011-11-26</date>
|
||||||
<plugin>com.woltlab.wcf.message</plugin> <!-- TODO: Correct me -->
|
<plugin>com.woltlab.wcf.message</plugin> <!-- TODO: Correct me -->
|
||||||
</packageinformation>
|
</packageinformation>
|
||||||
|
Loading…
Reference in New Issue
Block a user