X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fjabber.php;h=3dcdce5dbf349b87b629e9186bcb98ef519d22a9;hb=5702764e520f570839907444f09d6d9a23daee1e;hp=9108d1c4782ad46793fe1aff1b6dbdc3cff054cc;hpb=3ef4f251acbe8ebdfd9d7f1ea43b7344b7332b73;p=quix0rs-gnu-social.git diff --git a/lib/jabber.php b/lib/jabber.php index 9108d1c478..3dcdce5dbf 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -1,6 +1,6 @@ . * * @category Network - * @package Laconica - * @author Evan Prodromou - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -67,7 +67,7 @@ function jabber_normalize_jid($jid) } /** - * the JID of the Jabber daemon for this Laconica instance + * the JID of the Jabber daemon for this StatusNet instance * * @return string JID of the Jabber daemon */ @@ -77,6 +77,14 @@ function jabber_daemon_address() return common_config('xmpp', 'user') . '@' . common_config('xmpp', 'server'); } +class Sharing_XMPP extends XMPPHP_XMPP +{ + function getSocket() + { + return $this->socket; + } +} + /** * connect the configured Jabber account to the configured server * @@ -89,7 +97,7 @@ function jabber_connect($resource=null) { static $conn = null; if (!$conn) { - $conn = new XMPPHP_XMPP(common_config('xmpp', 'host') ? + $conn = new Sharing_XMPP(common_config('xmpp', 'host') ? common_config('xmpp', 'host') : common_config('xmpp', 'server'), common_config('xmpp', 'port'), @@ -179,7 +187,7 @@ function jabber_format_entry($profile, $notice) $xs->elementEnd('body'); $xs->elementEnd('html'); - $html = $xs->asString(); + $html = $xs->getString(); return $html . ' ' . $entry; } @@ -301,7 +309,7 @@ function jabber_special_presence($type, $to=null, $show=null, $status=null) * who have Jabber addresses, and have Jabber notification enabled, and * have this subscription enabled for Jabber. It also sends the notice to * all recipients of @-replies who have Jabber addresses and Jabber notification - * enabled. This is really the heart of Jabber distribution in Laconica. + * enabled. This is really the heart of Jabber distribution in StatusNet. * * @param Notice $notice The notice to broadcast *