don't calculate replies for remote notices
This commit is contained in:
parent
a9599d53c5
commit
891e002883
@ -333,8 +333,15 @@ class Notice extends Memcached_DataObject
|
|||||||
|
|
||||||
# Clear the cache for subscribed users, so they'll update at next request
|
# Clear the cache for subscribed users, so they'll update at next request
|
||||||
# XXX: someone clever could prepend instead of clearing the cache
|
# XXX: someone clever could prepend instead of clearing the cache
|
||||||
|
|
||||||
$notice->blowOnInsert();
|
$notice->blowOnInsert();
|
||||||
|
|
||||||
|
if (isset($replies)) {
|
||||||
|
$notice->saveKnownReplies($replies);
|
||||||
|
} else {
|
||||||
|
$notice->saveReplies();
|
||||||
|
}
|
||||||
|
|
||||||
$notice->distribute();
|
$notice->distribute();
|
||||||
|
|
||||||
return $notice;
|
return $notice;
|
||||||
@ -817,6 +824,26 @@ class Notice extends Memcached_DataObject
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveKnownReplies($uris)
|
||||||
|
{
|
||||||
|
foreach ($uris as $uri) {
|
||||||
|
|
||||||
|
$user = User::staticGet('uri', $uri);
|
||||||
|
|
||||||
|
if (!empty($user)) {
|
||||||
|
|
||||||
|
$reply = new Reply();
|
||||||
|
|
||||||
|
$reply->notice_id = $this->id;
|
||||||
|
$reply->profile_id = $user->id;
|
||||||
|
|
||||||
|
$id = $reply->insert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array of integer profile IDs
|
* @return array of integer profile IDs
|
||||||
*/
|
*/
|
||||||
|
@ -75,7 +75,7 @@ class DistribQueueHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$recipients = $notice->saveReplies();
|
$recipients = $notice->getReplies();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->logit($notice, $e);
|
$this->logit($notice, $e);
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,8 @@ class SalmonAction extends Action
|
|||||||
$options = array('is_local' => Notice::REMOTE_OMB,
|
$options = array('is_local' => Notice::REMOTE_OMB,
|
||||||
'uri' => $this->act->object->id,
|
'uri' => $this->act->object->id,
|
||||||
'url' => $this->act->object->link,
|
'url' => $this->act->object->link,
|
||||||
'rendered' => $rendered);
|
'rendered' => $rendered,
|
||||||
|
'replies' => $this->act->context->attention);
|
||||||
|
|
||||||
if (!empty($this->act->context->location)) {
|
if (!empty($this->act->context->location)) {
|
||||||
$options['lat'] = $location->lat;
|
$options['lat'] = $location->lat;
|
||||||
|
Loading…
Reference in New Issue
Block a user