summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 482bc550b..8552248ba 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -42,10 +42,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
*/
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
-/* We keep the first three 20-notice pages, plus one for pagination check,
+/* We keep 200 notices, the max number of notices available per API request,
* in the memcached cache. */
-define('NOTICE_CACHE_WINDOW', 61);
+define('NOTICE_CACHE_WINDOW', 200);
define('MAX_BOXCARS', 128);
@@ -90,7 +90,13 @@ class Notice extends Memcached_DataObject
function getProfile()
{
- return Profile::staticGet('id', $this->profile_id);
+ $profile = Profile::staticGet('id', $this->profile_id);
+
+ if (empty($profile)) {
+ throw new ServerException(sprintf(_('No such profile (%d) for notice (%d)'), $this->profile_id, $this->id));
+ }
+
+ return $profile;
}
function delete()