*/
function isMyNotice($notice) {
$types = $this->types();
- return in_array($notice->object_type, $types);
+ return ($notice->verb == ActivityVerb::POST) && in_array($notice->object_type, $types);
}
/**
function isMyActivity($activity) {
$types = $this->types();
return (count($activity->objects) == 1 &&
+ ($activity->objects[0] instanceof ActivityObject) &&
+ ($activity->verb == ActivityVerb::POST) &&
in_array($activity->objects[0]->type, $types));
}
*
* @return boolean hook value
*/
- function onStartHandleFeedEntryWithProfile($activity, $oprofile)
+ function onStartHandleFeedEntryWithProfile($activity, $oprofile, &$notice)
{
if ($this->isMyActivity($activity)) {
$options = array('uri' => $object->id,
'url' => $object->link,
- 'is_local' => Notice::REMOTE_OMB,
+ 'is_local' => Notice::REMOTE,
'source' => 'ostatus');
// $actor is an ostatus_profile
- $this->saveNoticeFromActivity($activity, $actor->localProfile(), $options);
+ $notice = $this->saveNoticeFromActivity($activity, $actor->localProfile(), $options);
return false;
}
$options = array('uri' => $object->id,
'url' => $object->link,
- 'is_local' => Notice::REMOTE_OMB,
+ 'is_local' => Notice::REMOTE,
'source' => 'ostatus');
// $actor is an ostatus_profile
$options = array('source' => 'atompub');
// $user->getProfile() is a Profile
- $this->saveNoticeFromActivity($activity,
- $user->getProfile(),
- $options);
+ $notice = $this->saveNoticeFromActivity($activity,
+ $user->getProfile(),
+ $options);
return false;
}