MDL-39398 message: Prevent notice when sending Jabber messages

Not tracking the presence prevents a notice to be displayed during disconnect(),
where the the jabber server attempts to subscribe to $CFG->jabberusername presence.
As the server name does not include a resource identifier (stillwit@jabber.org/resource),
an explode('/') fails.
This commit is contained in:
Frederic Massart 2013-04-29 14:10:44 +08:00
parent 2a6c9c1536
commit 81d6802709

View file

@ -73,6 +73,9 @@ class message_output_jabber extends message_output {
$conn = new XMPPHP_XMPP($CFG->jabberhost,$CFG->jabberport,$CFG->jabberusername,$CFG->jabberpassword,'moodle',$CFG->jabberserver); $conn = new XMPPHP_XMPP($CFG->jabberhost,$CFG->jabberport,$CFG->jabberusername,$CFG->jabberpassword,'moodle',$CFG->jabberserver);
// No need to track the presence during the sending message process.
$conn->track_presence = false;
try { try {
//$conn->useEncryption(false); //$conn->useEncryption(false);
$conn->connect(); $conn->connect();