diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-18 11:45:48 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-18 11:45:48 -0700 |
commit | 3f54840b51d5565fdeb7057661ff730bc0e41833 (patch) | |
tree | 7bb2ab81f6523ccfb46eb4e5f3cd4d9ba7d56389 /classes/User.php | |
parent | b761cfd4094c778b533cf77570b655d25cfced6b (diff) |
Only show twitter msgs in your own inbox
Diffstat (limited to 'classes/User.php')
-rw-r--r-- | classes/User.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/classes/User.php b/classes/User.php index c7eede94e..e8c8c5a75 100644 --- a/classes/User.php +++ b/classes/User.php @@ -442,6 +442,33 @@ class User extends Memcached_DataObject $qry = 'SELECT notice.* ' . 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . + 'WHERE subscription.subscriber = %d ' . + 'AND notice.is_local != ' . NOTICE_GATEWAY; + return Notice::getStream(sprintf($qry, $this->id), + 'user:notices_with_friends:' . $this->id, + $offset, $limit, $since_id, $before_id, + $order, $since); + } else if ($enabled === true || + ($enabled == 'transitional' && $this->inboxed == 1)) { + + $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false); + + return Notice::getStreamByIds($ids); + } + } + + function noticeInbox($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null) + { + $enabled = common_config('inboxes', 'enabled'); + + // Complicated code, depending on whether we support inboxes yet + // XXX: make this go away when inboxes become mandatory + + if ($enabled === false || + ($enabled == 'transitional' && $this->inboxed == 0)) { + $qry = + 'SELECT notice.* ' . + 'FROM notice JOIN subscription ON notice.profile_id = subscription.subscribed ' . 'WHERE subscription.subscriber = %d '; return Notice::getStream(sprintf($qry, $this->id), 'user:notices_with_friends:' . $this->id, @@ -450,7 +477,7 @@ class User extends Memcached_DataObject } else if ($enabled === true || ($enabled == 'transitional' && $this->inboxed == 1)) { - $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since); + $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true); return Notice::getStreamByIds($ids); } |