]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show WebSub state on remote user profiles
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 1 May 2017 19:18:04 +0000 (21:18 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 1 May 2017 19:18:04 +0000 (21:18 +0200)
plugins/OStatus/OStatusPlugin.php

index cea405fa9a9e2718aae5be8d6f082ecad1e596aa..d12881cde4a1fd07e7c6507bb70881da26e3e0e8 100644 (file)
@@ -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)
     {