PHPDaemon\Clients\XMPP\Connection::message PHP Метод

message() публичный Метод

Send XMPP Message
public message ( string $to, string $body, string $type = 'chat', string $subject = null, $payload = null )
$to string
$body string
$type string
$subject string
    public function message($to, $body, $type = 'chat', $subject = null, $payload = null)
    {
        if ($type === null) {
            $type = 'chat';
        }
        $to = htmlspecialchars($to);
        $body = htmlspecialchars($body);
        $subject = htmlspecialchars($subject);
        $out = '<message from="' . $this->fulljid . '" to="' . $to . '" type="' . $type . '">';
        if ($subject) {
            $out .= '<subject>' . $subject . '</subject>';
        }
        $out .= '<body>' . $body . '</body>';
        if ($payload) {
            $out .= $payload;
        }
        $out .= "</message>";
        $this->sendXML($out);
    }