From: Mikael Nordfeldth Date: Mon, 1 May 2017 19:18:04 +0000 (+0200) Subject: Show WebSub state on remote user profiles X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;ds=inline;h=5af5bb2a32b0cce7e31bb4dfb86358b8db669428;p=quix0rs-gnu-social.git Show WebSub state on remote user profiles --- diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index cea405fa9a..d12881cde4 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -1195,6 +1195,25 @@ class OStatusPlugin extends Plugin return true; } + function onEndShowAccountProfileBlock(HTMLOutputter $out, Profile $profile) + { + if ($profile->isLocal()) { + return true; + } + $websub_states = [ + 'subscribe' => _m('Pending'), + 'active' => _m('Active'), + 'nohub' => _m('Polling'), + 'inactive' => _m('Inactive'), + ]; + $out->elementStart('dl', 'entity_tags ostatus_profile'); + $oprofile = Ostatus_profile::fromProfile($profile); + $feedsub = $oprofile->getFeedSub(); + $out->element('dt', null, _m('WebSub')); + $out->element('dd', null, $websub_states[$feedsub->sub_state]); + $out->elementEnd('dl'); + } + // FIXME: This one can accept both an Action and a Widget. Confusing! Refactor to (HTMLOutputter $out, Profile $target)! function onStartProfileListItemActionElements($item) {