]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
hide poll response notices from threaded view
authorEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 21:07:03 +0000 (17:07 -0400)
committerEvan Prodromou <evan@status.net>
Sat, 9 Apr 2011 21:07:03 +0000 (17:07 -0400)
plugins/Poll/PollPlugin.php

index 4e7b2c5273140a6b06ada0c1b336e7e389b4821a..f9b5808b1cb20779a287ee49a2ee022b1c67c5ee 100644 (file)
@@ -480,4 +480,18 @@ class PollPlugin extends MicroAppPlugin
         // TRANS: Application title.
         return _m('APPTITLE','Poll');
     }
+
+    function onStartShowThreadedNoticeTail($nli, $notice, &$children)
+    {
+        // Filter out any poll responses
+        if ($notice->object_type == self::POLL_OBJECT) {
+            $children = array_filter($children, array($this, 'isNotPollResponse'));
+        }
+        return true;
+    }
+
+    function isNotPollResponse($notice)
+    {
+        return ($notice->object_type != self::POLL_RESPONSE_OBJECT);
+    }
 }