summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-21 23:56:48 -0500
committerEvan Prodromou <evan@status.net>2010-02-21 23:56:48 -0500
commit891e0028838e51788e917d947cc280dbd53c1792 (patch)
tree0ab5fa9da85ae90ca99a2479b31325c82ebcd65f /classes/Notice.php
parenta9599d53c5e33eff2927f02393b9ae6984ba3a6e (diff)
don't calculate replies for remote notices
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 6f1ef81fc..a12839d72 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -333,8 +333,15 @@ class Notice extends Memcached_DataObject
# Clear the cache for subscribed users, so they'll update at next request
# XXX: someone clever could prepend instead of clearing the cache
+
$notice->blowOnInsert();
+ if (isset($replies)) {
+ $notice->saveKnownReplies($replies);
+ } else {
+ $notice->saveReplies();
+ }
+
$notice->distribute();
return $notice;
@@ -817,6 +824,26 @@ class Notice extends Memcached_DataObject
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
*/