summaryrefslogtreecommitdiff
path: root/classes/Notice_inbox.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-06-24 01:18:35 +0800
committerJeffery To <jeffery.to@gmail.com>2009-06-24 01:18:35 +0800
commit65f784120b45dc187e28313fa2c2dca2c976c150 (patch)
treecf1cb3e34483466d4f4a312c528579292e7603fc /classes/Notice_inbox.php
parentf7d488d4b2bfdc8dfa6b5a2bc2931dbf824509a0 (diff)
parenteb40fbc17ad1efb0a4c51ee00b1e9408d2af382f (diff)
Merge branch '0.8.x' into notice-search-no-results
Diffstat (limited to 'classes/Notice_inbox.php')
-rw-r--r--classes/Notice_inbox.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/classes/Notice_inbox.php b/classes/Notice_inbox.php
index 673e187c7..4ca2e9ae3 100644
--- a/classes/Notice_inbox.php
+++ b/classes/Notice_inbox.php
@@ -25,6 +25,10 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
define('INBOX_CACHE_WINDOW', 101);
+define('NOTICE_INBOX_SOURCE_SUB', 1);
+define('NOTICE_INBOX_SOURCE_GROUP', 2);
+define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
+
class Notice_inbox extends Memcached_DataObject
{
###START_AUTOCODE
@@ -43,20 +47,25 @@ class Notice_inbox extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
- function stream($user_id, $offset, $limit, $since_id, $max_id, $since)
+ function stream($user_id, $offset, $limit, $since_id, $max_id, $since, $own=false)
{
return Notice::stream(array('Notice_inbox', '_streamDirect'),
- array($user_id),
- 'notice_inbox:by_user:'.$user_id,
+ array($user_id, $own),
+ ($own) ? 'notice_inbox:by_user:'.$user_id :
+ 'notice_inbox:by_user_own:'.$user_id,
$offset, $limit, $since_id, $max_id, $since);
}
- function _streamDirect($user_id, $offset, $limit, $since_id, $max_id, $since)
+ function _streamDirect($user_id, $own, $offset, $limit, $since_id, $max_id, $since)
{
$inbox = new Notice_inbox();
$inbox->user_id = $user_id;
+ if (!$own) {
+ $inbox->whereAdd('source != ' . NOTICE_INBOX_SOURCE_GATEWAY);
+ }
+
if ($since_id != 0) {
$inbox->whereAdd('notice_id > ' . $since_id);
}