1<?php
2
3require_once(dirname(__FILE__)."/../pfccommand.class.php");
4
5class pfcCommand_notice extends pfcCommand
6{
7  function run(&$xml_reponse, $p)
8  {
9    $clientid    = $p["clientid"];
10    $msg         = $p["param"];
11    $sender      = $p["sender"];
12    $recipient   = $p["recipient"];
13    $recipientid = $p["recipientid"];
14    $flag        = isset($p["flag"]) ? $p["flag"] : 7;
15
16    $c  =& pfcGlobalConfig::Instance();
17    $u  =& pfcUserConfig::Instance();
18    $ct =& pfcContainer::Instance();
19
20    if ($c->shownotice > 0 &&
21        ($c->shownotice & $flag) == $flag)
22    {
23      $msg = phpFreeChat::FilterSpecialChar($msg);
24      $nick = $ct->getNickname($u->nickid);
25      $res = $ct->write($recipient, $nick, "notice", $msg);
26      if (is_array($res))
27      {
28        $cmdp = $p;
29        $cmdp["param"] = implode(",",$res);
30        $cmd =& pfcCommand::Factory("error");
31        $cmd->run($xml_reponse, $cmdp);
32        return;
33      }
34    }
35  }
36}
37
38?>
39