diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2008-10-22 16:56:21 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2008-10-22 16:56:21 -0400 |
commit | 74291968c4b4f1fca29cb79caad695a1e2360734 (patch) | |
tree | 5f19d1cfbbcf10699638f0663303d9fecf81e0a4 /classes/Notice.php | |
parent | a15034bea561c778207c899d5893dbf6bfc3b637 (diff) |
save notice to inbox on saveNew
darcs-hash:20081022205621-5ed1f-4103d4db9713f4e6e65647f71cc788cbee56a240.gz
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index cb153a2e5..17e0c5a0f 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -131,7 +131,8 @@ class Notice extends Memcached_DataObject if (common_config('memcached', 'enabled')) { $notice->blowCaches(); } - + + $notice->addToInboxes(); return $notice; } @@ -307,7 +308,7 @@ class Notice extends Memcached_DataObject return $wrapper; } - + function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0) { $needAnd = FALSE; @@ -346,4 +347,17 @@ class Notice extends Memcached_DataObject 'public', $offset, $limit); } + + function addToInboxes() { + + $inbox = new Notice_inbox(); + + $inbox->query('INSERT INTO notice_inbox (user_id, notice_id) ' . + 'SELECT user.id, ' . $this->id . ' ' . + 'FROM user JOIN subscription ON user.id = subscription.subscriber ' . + 'WHERE subscription.subscribed = ' . $this->profile_id); + + return; + } } + |