]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Hide RSVPs from threaded notice output
authorEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 21:11:38 +0000 (17:11 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 21:11:38 +0000 (17:11 -0400)
plugins/Event/EventPlugin.php

index aca2922f177e324e574aaf4299c2c52890da2e05..978b4610b2019df4111c39cb4905bac02d090599 100644 (file)
@@ -488,4 +488,18 @@ class EventPlugin extends MicroappPlugin
         $action->cssLink($this->path('event.css'));
         return true;
     }
+
+    function onStartShowThreadedNoticeTail($nli, $notice, &$children)
+    {
+        // Filter out any poll responses
+        if ($notice->object_type == Happening::OBJECT_TYPE) {
+            $children = array_filter($children, array($this, 'isNotRSVP'));
+        }
+        return true;
+    }
+
+    function isNotRSVP($notice)
+    {
+        return (!in_array($notice->object_type, array(RSVP::POSITIVE, RSVP::NEGATIVE, RSVP::POSSIBLE)));
+    }
 }