1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

More docs.

This commit is contained in:
Tim Düsterhus 2012-06-04 21:10:03 +02:00
parent 58c8d336c6
commit d7f91715e4
4 changed files with 46 additions and 2 deletions

View File

@ -38,7 +38,6 @@ public function __toString() {
return $this->getTitle();
}
/**
* Returns whether the user is allowed to enter the room.
*
@ -49,11 +48,14 @@ public function canEnter() {
$suspensions = ChatSuspension::getSuspensionsForUser();
$canEnter = $ph->getPermission($this, 'user.canEnter');
// room suspension
if ($canEnter && isset($suspensions[$this->roomID][ChatSuspension::TYPE_BAN])) {
if ($suspensions[$this->roomID][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) {
$canEnter = false;
}
}
// global suspension
if ($canEnter && isset($suspensions[null][ChatSuspension::TYPE_BAN])) {
if ($suspensions[null][ChatSuspension::TYPE_BAN]['time'] > TIME_NOW) {
$canEnter = false;
@ -73,11 +75,14 @@ public function canWrite() {
$suspensions = ChatSuspension::getSuspensionsForUser();
$canWrite = $ph->getPermission($this, 'user.canWrite');
// room suspension
if ($canWrite && isset($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE])) {
if ($suspensions[$this->roomID][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) {
$canWrite = false;
}
}
// global suspension
if ($canWrite && isset($suspensions[null][ChatSuspension::TYPE_MUTE])) {
if ($suspensions[null][ChatSuspension::TYPE_MUTE]['time'] > TIME_NOW) {
$canWrite = false;

View File

@ -15,11 +15,49 @@
* @subpackage form
*/
class ChatForm extends AbstractForm {
/**
* Should HTML be enabled for this message.
*
* @var integer
*/
public $enableHTML = 0;
/**
* Should smilies be enabled for this message.
*
* @var integer
*/
public $enableSmilies = 1;
/**
* @see \wcf\page\AbstractPage::$neededModules
*/
public $neededModules = array('CHAT_ACTIVE');
/**
* @see \wcf\page\AbstractPage::$neededPermissions
*/
public $neededPermissions = array('user.chat.canEnter');
/**
* The given message-string.
*
* @var string
*/
public $message = '';
/**
* The current room.
*
* @var \wcf\data\chat\room\ChatRoom
*/
public $room = null;
/**
* Values read from the UserStorage of the current user.
*
* @var array
*/
public $userData = array();
/**

View File

@ -20,6 +20,7 @@ class ChatPage extends AbstractPage {
* @var string
*/
public $chatVersion = '';
/**
* @see \wcf\page\AbstractPage::$neededModules
*/