- // Let's see if this has been deleted already.
- $deleted = Deleted_notice::getKV('uri', $act->id);
- if ($deleted instanceof Deleted_notice) {
- return $deleted;
+ // Everything is done in the StartNoticeSave event
+ return true;
+ }
+
+ // FIXME: Put this in lib/activityhandlerplugin.php when we're ready
+ // with the other microapps/activityhandlers as well.
+ // Also it should be StartNoticeAsActivity (with a prepped Activity, including ->context etc.)
+ public function onEndNoticeAsActivity(Notice $stored, Activity $act, Profile $scoped=null)
+ {
+ if (!$this->isMyNotice($stored)) {
+ return true;
+ }
+
+ common_debug('Extending activity '.$stored->id.' with '.get_called_class());
+ $this->extendActivity($stored, $act, $scoped);
+ return false;
+ }
+
+ /**
+ * This is run before ->insert, so our task in this function is just to
+ * delete if it is the delete verb.
+ */
+ public function onStartNoticeSave(Notice $stored)
+ {
+ // DELETE is a bit special, we have to remove the existing entry and then
+ // add a new one with the same URI in order to trigger the distribution.
+ // (that's why we don't use $this->isMyNotice(...))
+ if (!ActivityUtils::compareVerbs($stored->verb, array(ActivityVerb::DELETE))) {
+ return true;