exit(1);
}
-set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/XMPPHP');
-
/**
* Plugin for XMPP
*
return false;
}
- function daemon_screenname()
+ function daemonScreenname()
{
$ret = $this->user . '@' . $this->server;
if($this->resource)
switch ($cls)
{
case 'XMPPHP_XMPP':
- require_once 'XMPP.php';
+ require_once $dir . '/extlib/XMPPHP/XMPP.php';
return false;
case 'Sharing_XMPP':
case 'Queued_XMPP':
return 'xmpp:' . $screenname;
}
- function send_message($screenname, $body)
+ function sendMessage($screenname, $body)
{
$this->queuedConnection()->message($screenname, $body, 'chat');
}
- function send_notice($screenname, $notice)
+ function sendNotice($screenname, $notice)
{
- $msg = $this->format_notice($notice);
+ $msg = $this->formatNotice($notice);
$entry = $this->format_entry($notice);
$this->queuedConnection()->message($screenname, $msg, 'chat', null, $entry);
$xs->text(" ");
$xs->element('a', array(
'href'=>common_local_url('conversation',
- array('id' => $notice->conversation)).'#notice-'.$notice->id
- ),sprintf(_('[%s]'),$notice->id));
+ array('id' => $notice->conversation)).'#notice-'.$notice->id),
+ // TRANS: %s is a notice ID.
+ sprintf(_m('[%s]'),$notice->id));
$xs->elementEnd('body');
$xs->elementEnd('html');
return $html . ' ' . $entry;
}
- function receive_raw_message($pl)
+ function receiveRawMessage($pl)
{
$from = $this->normalize($pl['from']);
if ($pl['type'] != 'chat') {
- common_log(LOG_WARNING, "Ignoring message of type ".$pl['type']." from $from.");
- return true;
+ $this->log(LOG_WARNING, "Ignoring message of type ".$pl['type']." from $from: " . $pl['xml']->toString());
+ return;
}
if (mb_strlen($pl['body']) == 0) {
- common_log(LOG_WARNING, "Ignoring message with empty body from $from.");
- return true;
+ $this->log(LOG_WARNING, "Ignoring message with empty body from $from: " . $pl['xml']->toString());
+ return;
}
- $this->handle_incoming($from, $pl['body']);
+ $this->handleIncoming($from, $pl['body']);
return true;
}