summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php33
1 files changed, 10 insertions, 23 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 9bda47827..306956422 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -125,8 +125,7 @@ class Notice extends Memcached_DataObject
'Fave',
'Notice_tag',
'Group_inbox',
- 'Queue_item',
- 'Notice_inbox');
+ 'Queue_item');
foreach ($related as $cls) {
$inst = new $cls();
@@ -300,8 +299,6 @@ class Notice extends Memcached_DataObject
// XXX: some of these functions write to the DB
- $notice->query('BEGIN');
-
$id = $notice->insert();
if (!$id) {
@@ -343,8 +340,6 @@ class Notice extends Memcached_DataObject
$notice->saveUrls();
- $notice->query('COMMIT');
-
Event::handle('EndNoticeSave', array($notice));
}
@@ -504,17 +499,6 @@ class Notice extends Memcached_DataObject
unset($original);
}
- $ni = new Notice_inbox();
-
- $ni->notice_id = $this->id;
-
- if ($ni->find()) {
- while ($ni->fetch()) {
- $tmk = common_cache_key('user:repeated_to_me:'.$ni->user_id);
- $cache->delete($tmk);
- }
- }
-
$ni->free();
unset($ni);
}
@@ -842,12 +826,8 @@ class Notice extends Memcached_DataObject
return $ids;
}
- function addToInboxes()
+ function whoGets()
{
- // XXX: loads constants
-
- $inbox = new Notice_inbox();
-
$users = $this->getSubscribedUsers();
// FIXME: kind of ignoring 'transitional'...
@@ -887,7 +867,14 @@ class Notice extends Memcached_DataObject
}
}
- Notice_inbox::bulkInsert($this->id, $this->created, $ni);
+ return $ni;
+ }
+
+ function addToInboxes()
+ {
+ $ni = $this->whoGets();
+
+ Inbox::bulkInsert($this->id, array_keys($ni));
return;
}