* added payload option to messages

git-svn-id: svn://netflint.net/xmpphp@47 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy
2008-07-11 23:25:36 +00:00
parent d2b45506b5
commit 895021132c
3 changed files with 27 additions and 54 deletions

View File

@@ -143,14 +143,16 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream {
* @param string $type
* @param string $subject
*/
public function message($to, $body, $type = 'chat', $subject = null) {
public function message($to, $body, $type = 'chat', $subject = null, $payload = null) {
$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></message>";
$out .= "<body>$body</body>";
if($payload) $out .= $payload;
$out .= "</message>";
$this->send($out);
}