X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FXmpp%2FXmppPlugin.php;h=f8476cd8f2b2fadc7864bcf3760fd83debc6840f;hb=21778d057e38d33d45abd5b5f1289e86dd159415;hp=8b337a5f2713a7c91bc2c54dbd61651f14b1ccd9;hpb=64dbd93534444754bc39fafbc3a398b72809fc45;p=quix0rs-gnu-social.git diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php index 8b337a5f27..f8476cd8f2 100644 --- a/plugins/Xmpp/XmppPlugin.php +++ b/plugins/Xmpp/XmppPlugin.php @@ -49,7 +49,7 @@ class XmppPlugin extends ImPlugin public $server = null; public $port = 5222; public $user = 'update'; - public $resource = null; + public $resource = 'gnusocial'; public $encryption = true; public $password = null; public $host = null; // only set if != server @@ -59,7 +59,7 @@ class XmppPlugin extends ImPlugin function getDisplayName(){ // TRANS: Plugin display name. - return _m('XMPP/Jabber/GTalk'); + return _m('XMPP/Jabber'); } /** @@ -308,11 +308,6 @@ class XmppPlugin extends ImPlugin return true; } - function microiduri($screenname) - { - return 'xmpp:' . $screenname; - } - function sendMessage($screenname, $body) { $this->queuedConnection()->message($screenname, $body, 'chat'); @@ -346,22 +341,22 @@ class XmppPlugin extends ImPlugin $xs->elementStart('body', array('xmlns' => 'http://www.w3.org/1999/xhtml')); $xs->element('a', array('href' => $profile->profileurl), $profile->nickname); try { - $orig_profile = $notice->getParent()->getProfile(); + $parent = $notice->getParent(); + $orig_profile = $parent->getProfile(); $orig_profurl = $orig_profile->getUrl(); $xs->text(" => "); $xs->element('a', array('href' => $orig_profurl), $orig_profile->nickname); $xs->text(": "); } catch (InvalidUrlException $e) { $xs->text(sprintf(' => %s', $orig_profile->nickname)); - } catch (Exception $e) { + } catch (NoParentNoticeException $e) { + $xs->text(": "); + } catch (NoResultException $e) { + // Parent notice was probably deleted. $xs->text(": "); } - if (!empty($notice->rendered)) { - $notice->rendered = str_replace("\t", "", $notice->rendered); - $xs->raw($notice->rendered); - } else { - $xs->raw(common_render_content($notice->content, $notice)); - } + // FIXME: Why do we replace \t with ''? is it just to make it pretty? shouldn't whitespace be handled well...? + $xs->raw(str_replace("\t", "", $notice->getRendered())); $xs->text(" "); $xs->element('a', array( 'href'=>common_local_url('conversation', @@ -461,12 +456,12 @@ class XmppPlugin extends ImPlugin } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'XMPP', - 'version' => STATUSNET_VERSION, + 'version' => GNUSOCIAL_VERSION, 'author' => 'Craig Andrews, Evan Prodromou', - 'homepage' => 'http://status.net/wiki/Plugin:XMPP', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/XMPP', 'rawdescription' => // TRANS: Plugin description. _m('The XMPP plugin allows users to send and receive notices over the XMPP/Jabber network.'));