summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-30 04:40:47 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-05-30 04:40:47 -0400
commit76ee1fd5daa6ab1999224d8e93df1b7116f24c36 (patch)
tree34a952af81f736f7dff012b60050eb84aa57013f /classes
parent45c58c74d4d2c2c0a886ff7816f27aa9c6033652 (diff)
Removing inbox and memcached daemon handling
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php54
1 files changed, 3 insertions, 51 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 3a90d18b4..b4c86ebeb 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -196,12 +196,8 @@ class Notice extends Memcached_DataObject
$notice->saveReplies();
$notice->saveTags();
- if (common_config('queue', 'enabled')) {
- $notice->addToAuthorInbox();
- } else {
- $notice->addToInboxes();
- $notice->saveGroups();
- }
+ $notice->addToInboxes();
+ $notice->saveGroups();
$notice->query('COMMIT');
@@ -211,13 +207,7 @@ 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
- if (common_config('memcached', 'enabled')) {
- if (common_config('queue', 'enabled')) {
- $notice->blowAuthorCaches();
- } else {
- $notice->blowCaches();
- }
- }
+ $notice->blowCaches();
return $notice;
}
@@ -280,17 +270,6 @@ class Notice extends Memcached_DataObject
$this->blowGroupCache($blowLast);
}
- function blowAuthorCaches($blowLast=false)
- {
- // Clear the user's cache
- $cache = common_memcache();
- if (!empty($cache)) {
- $cache->delete(common_cache_key('notice_inbox:by_user:'.$this->profile_id));
- }
- $this->blowNoticeCache($blowLast);
- $this->blowPublicCache($blowLast);
- }
-
function blowGroupCache($blowLast=false)
{
$cache = common_memcache();
@@ -709,33 +688,6 @@ class Notice extends Memcached_DataObject
return;
}
- function addToAuthorInbox()
- {
- $enabled = common_config('inboxes', 'enabled');
-
- if ($enabled === true || $enabled === 'transitional') {
- $user = User::staticGet('id', $this->profile_id);
- if (empty($user)) {
- return;
- }
- $inbox = new Notice_inbox();
- $UT = common_config('db','type')=='pgsql'?'"user"':'user';
- $qry = 'INSERT INTO notice_inbox (user_id, notice_id, created) ' .
- "SELECT $UT.id, " . $this->id . ", '" . $this->created . "' " .
- "FROM $UT " .
- "WHERE $UT.id = " . $this->profile_id . ' ' .
- 'AND NOT EXISTS (SELECT user_id, notice_id ' .
- 'FROM notice_inbox ' .
- "WHERE user_id = " . $this->profile_id . ' '.
- 'AND notice_id = ' . $this->id . ' )';
- if ($enabled === 'transitional') {
- $qry .= " AND $UT.inboxed = 1";
- }
- $inbox->query($qry);
- }
- return;
- }
-
function saveGroups()
{
$enabled = common_config('inboxes', 'enabled');