1<?php
2
3require_once(dirname(__FILE__)."/../pfccommand.class.php");
4
5class pfcCommand_me extends pfcCommand
6{
7  var $usage = "/me {message}";
8
9  function run(&$xml_reponse, $p)
10  {
11    $clientid    = $p["clientid"];
12    $param       = $p["param"];
13    $sender      = $p["sender"];
14    $recipient   = $p["recipient"];
15    $recipientid = $p["recipientid"];
16
17    $c  =& pfcGlobalConfig::Instance();
18    $u  =& pfcUserConfig::Instance();
19    $ct =& pfcContainer::Instance();
20
21    if (trim($param) == "")
22    {
23      // error
24      $cmdp = $p;
25      $cmdp["param"] = _pfc("Missing parameter");
26      $cmdp["param"] .= " (".$this->usage.")";
27      $cmd =& pfcCommand::Factory("error");
28      $cmd->run($xml_reponse, $cmdp);
29      return;
30    }
31
32    $msg = phpFreeChat::PreFilterMsg($param);
33    $ct->write($recipient, $sender, $this->name, $msg);
34  }
35}
36
37?>
38