' modified = "%s" '.
'WHERE user_id = %d '.
'AND notice_id = %d',
- Fave::newUri($fave->user_id, $fave->notice_id, $fave->modified),
+ Fave::newUri($fave->getActor(), $fave->getTarget(), $fave->modified),
common_sql_date(strtotime($fave->modified)),
$fave->user_id,
$fave->notice_id));
{
assert($this->isMyActivity($act));
- // If empty, we should've created it ourselves on our node.
- if (!isset($options['created'])) {
- $options['created'] = !empty($act->time) ? common_sql_date($act->time) : common_sql_now();
- }
-
// We must have an objects[0] here because in isMyActivity we require the count to be == 1
$actobj = $act->objects[0];
$object = Fave::saveActivityObject($actobj, $stored);
+
return $object;
}
return true;
}
- common_debug('Extending activity '.$stored->id.' with '.get_called_class());
$this->extendActivity($stored, $act, $scoped);
return false;
}
}
}
- public function showNoticeListItem(NoticeListItem $nli)
+ protected function showNoticeListItem(NoticeListItem $nli)
{
// pass
}
return true;
}
- public function onStartShowThreadedNoticeTailItems(NoticeListItem $nli, Notice $notice, &$threadActive)
+ public function onEndShowThreadedNoticeTailItems(NoticeListItem $nli, Notice $notice, &$threadActive)
{
if ($nli instanceof ThreadedNoticeListSubItem) {
// The sub-items are replies to a conversation, thus we use different HTML elements etc.
$expected_verb = $exists ? ActivityVerb::UNFAVORITE : ActivityVerb::FAVORITE;
switch (true) {
- case $exists && ActivityUtils::compareTypes($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
- case !$exists && ActivityUtils::compareTypes($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
+ case $exists && ActivityUtils::compareVerbs($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
+ case !$exists && ActivityUtils::compareVerbs($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
common_redirect(common_local_url('activityverb',
array('id' => $target->getID(),
'verb' => ActivityUtils::resolveUri($expected_verb, true))));
protected function doActionPost(ManagedAction $action, $verb, Notice $target, Profile $scoped)
{
switch (true) {
- case ActivityUtils::compareTypes($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
+ case ActivityUtils::compareVerbs($verb, array(ActivityVerb::FAVORITE, ActivityVerb::LIKE)):
Fave::addNew($scoped, $target);
break;
- case ActivityUtils::compareTypes($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
+ case ActivityUtils::compareVerbs($verb, array(ActivityVerb::UNFAVORITE, ActivityVerb::UNLIKE)):
Fave::removeEntry($scoped, $target);
break;
default: