* @package be.bastelstu.chat * @subpackage system.chat.command.commands */ class GmuteCommand extends MuteCommand { public function executeAction() { $room = new \chat\data\room\Room(null, array('roomID' => null)); if ($suspension = suspension\Suspension::getSuspensionByUserRoomAndType($this->user, $room, static::SUSPENSION_TYPE)) { if ($suspension->expires >= $this->expires) { throw new \wcf\system\exception\UserInputException('text', WCF::getLanguage()->get('wcf.chat.suspension.exists')); } $action = new suspension\SuspensionAction(array($suspension), 'delete'); $action->executeAction(); } $this->suspensionAction = new suspension\SuspensionAction(array(), 'create', array( 'data' => array( 'userID' => $this->user->userID, 'roomID' => null, 'type' => static::SUSPENSION_TYPE, 'expires' => $this->expires, 'time' => TIME_NOW, 'issuer' => WCF::getUser()->userID, 'reason' => $this->reason ) )); $this->suspensionAction->executeAction(); } }