]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Event/EventPlugin.php
Merge remote-tracking branch 'gitorious/1.0.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / Event / EventPlugin.php
index 0cb62cf59e1ecfad98e43d5e0454d89c5360b851..c88c42b396ff74f4a5ebfb8a25b69eb848c2c8db 100644 (file)
@@ -165,7 +165,8 @@ class EventPlugin extends MicroappPlugin
     function saveNoticeFromActivity($activity, $actor, $options=array())
     {
         if (count($activity->objects) != 1) {
-            throw new Exception(_('Too many activity objects.'));
+            // TRANS: Exception thrown when there are too many activity objects.
+            throw new Exception(_m('Too many activity objects.'));
         }
 
         $happeningObj = $activity->objects[0];
@@ -296,6 +297,7 @@ class EventPlugin extends MicroappPlugin
             return new RSVPListItem($nli);
             break;
         }
+        return null;
     }
 
 
@@ -347,17 +349,13 @@ class EventPlugin extends MicroappPlugin
         return true;
     }
 
-    function onStartShowThreadedNoticeTail($nli, $notice, &$children)
+    function onStartAddNoticeReply($nli, $parent, $child)
     {
         // Filter out any poll responses
-        if ($notice->object_type == Happening::OBJECT_TYPE) {
-            $children = array_filter($children, array($this, 'isNotRSVP'));
+        if (($parent->object_type == Happening::OBJECT_TYPE) &&
+            in_array($child->object_type, array(RSVP::POSITIVE, RSVP::NEGATIVE, RSVP::POSSIBLE))) {
+            return false;
         }
         return true;
     }
-
-    function isNotRSVP($notice)
-    {
-        return (!in_array($notice->object_type, array(RSVP::POSITIVE, RSVP::NEGATIVE, RSVP::POSSIBLE)));
-    }
 }