Suppress a notice when the body element is not passed.

This commit is contained in:
Mat Gadd 2010-02-11 12:33:11 +00:00
parent 1e76ca74de
commit 911cd4b974

View File

@ -229,10 +229,11 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream {
} else {
$payload['type'] = 'chat';
}
$body = $xml->sub('body');
$payload['from'] = $xml->attrs['from'];
$payload['body'] = $xml->sub('body')->data;
$payload['body'] = is_object($body) ? $body->data : FALSE; // $xml->sub('body')->data;
$payload['xml'] = $xml;
$this->log->log("Message: {$xml->sub('body')->data}", XMPPHP_Log::LEVEL_DEBUG);
$this->log->log("Message: {$payload['body']}", XMPPHP_Log::LEVEL_DEBUG);
$this->event('message', $payload);
}