From 5af5bb2a32b0cce7e31bb4dfb86358b8db669428 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 1 May 2017 21:18:04 +0200 Subject: [PATCH] Show WebSub state on remote user profiles --- plugins/OStatus/OStatusPlugin.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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) {