remove inboxes option
This commit is contained in:
parent
67c387c6a0
commit
4f5badda94
41
README
41
README
|
@ -839,40 +839,8 @@ to update it.
|
|||
Notice inboxes
|
||||
--------------
|
||||
|
||||
Before version 0.6.2, the page showing all notices from people the
|
||||
user is subscribed to ("so-and-so with friends") was calculated at run
|
||||
time. Starting with 0.6.2, we have a new data structure for holding a
|
||||
user's "notice inbox". (Note: distinct from the "message inbox", which
|
||||
is the "inbox" tab in the UI. The notice inbox appears under the
|
||||
"Personal" tab.)
|
||||
|
||||
Notices are added to the inbox when they're created. This speeds up
|
||||
the query considerably, and also allows us the opportunity, in the
|
||||
future, to add different kind of notices to an inbox -- like @-replies
|
||||
or subscriptions to search terms or hashtags.
|
||||
|
||||
Notice inboxes are enabled by default for new installations. If you
|
||||
are upgrading an existing site, this means that your users will see
|
||||
empty "Personal" pages. The following steps will help you fix the
|
||||
problem.
|
||||
|
||||
0. $config['inboxes']['enabled'] can be set to one of three values. If
|
||||
you set it to 'false', the site will work as before. Support for this
|
||||
will probably be dropped in future versions.
|
||||
1. Setting the flag to 'transitional' means that you're in transition.
|
||||
In this mode, the code will run the "new query" or the "old query"
|
||||
based on whether the user's inbox has been updated.
|
||||
2. After setting the flag to "transitional", you can run the
|
||||
fixup_inboxes.php script to create the inboxes. You may want to set
|
||||
the memory limit high. You can re-run it without ill effect.
|
||||
3. When fixup_inboxes is finished, you can set the enabled flag to
|
||||
'true'.
|
||||
|
||||
NOTE: As of version 0.8.1 notice inboxes are automatically trimmed back
|
||||
to ~1000 notices every once in a while.
|
||||
|
||||
NOTE: we will drop support for non-inboxed sites in the 0.9.x version
|
||||
of StatusNet. It's time to switch now!
|
||||
Notice inboxes are now required. If you don't have inboxes enabled,
|
||||
StatusNet will no longer run.
|
||||
|
||||
UTF-8 Database
|
||||
--------------
|
||||
|
@ -1308,9 +1276,8 @@ inboxes
|
|||
|
||||
For notice inboxes.
|
||||
|
||||
enabled: A three-valued flag for whether to use notice inboxes (see
|
||||
upgrading info above for notes about this change). Can be
|
||||
'false', 'true', or '"transitional"'.
|
||||
enabled: No longer used. If you set this to something other than true,
|
||||
StatusNet will no longer run.
|
||||
|
||||
throttle
|
||||
--------
|
||||
|
|
|
@ -99,15 +99,6 @@ class ApiGroupCreateAction extends ApiAuthAction
|
|||
{
|
||||
parent::handle($args);
|
||||
|
||||
if (!common_config('inboxes', 'enabled')) {
|
||||
$this->serverError(
|
||||
_('Inboxes must be enabled for groups to work'),
|
||||
400,
|
||||
$this->format
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
|
||||
$this->clientError(
|
||||
_('This method requires a POST.'),
|
||||
|
|
|
@ -64,11 +64,6 @@ class EditgroupAction extends GroupDesignAction
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to create a group.'));
|
||||
return false;
|
||||
|
|
|
@ -68,11 +68,6 @@ class GroupbyidAction extends Action
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$id = $this->arg('id');
|
||||
|
||||
if (!$id) {
|
||||
|
|
|
@ -64,11 +64,6 @@ class GroupDesignSettingsAction extends DesignSettingsAction
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes', 'enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to edit a group.'));
|
||||
return false;
|
||||
|
|
|
@ -66,11 +66,6 @@ class GrouplogoAction extends GroupDesignAction
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to create a group.'));
|
||||
return false;
|
||||
|
|
|
@ -76,11 +76,6 @@ class groupRssAction extends Rss10Action
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$nickname_arg = $this->arg('nickname');
|
||||
$nickname = common_canonical_nickname($nickname_arg);
|
||||
|
||||
|
|
|
@ -56,11 +56,6 @@ class JoingroupAction extends Action
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to join a group.'));
|
||||
return false;
|
||||
|
|
|
@ -56,11 +56,6 @@ class LeavegroupAction extends Action
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work.'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to leave a group.'));
|
||||
return false;
|
||||
|
|
|
@ -61,11 +61,6 @@ class NewgroupAction extends Action
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!common_logged_in()) {
|
||||
$this->clientError(_('You must be logged in to create a group.'));
|
||||
return false;
|
||||
|
|
|
@ -101,11 +101,6 @@ class ShowgroupAction extends GroupDesignAction
|
|||
{
|
||||
parent::prepare($args);
|
||||
|
||||
if (!common_config('inboxes','enabled')) {
|
||||
$this->serverError(_('Inboxes must be enabled for groups to work'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
|
||||
|
||||
$nickname_arg = $this->arg('nickname');
|
||||
|
|
|
@ -111,10 +111,9 @@ class Notice extends Memcached_DataObject
|
|||
'Fave',
|
||||
'Notice_tag',
|
||||
'Group_inbox',
|
||||
'Queue_item');
|
||||
if (common_config('inboxes', 'enabled')) {
|
||||
$related[] = 'Notice_inbox';
|
||||
}
|
||||
'Queue_item',
|
||||
'Notice_inbox');
|
||||
|
||||
foreach ($related as $cls) {
|
||||
$inst = new $cls();
|
||||
$inst->notice_id = $this->id;
|
||||
|
@ -883,10 +882,6 @@ class Notice extends Memcached_DataObject
|
|||
|
||||
function addToInboxes()
|
||||
{
|
||||
$enabled = common_config('inboxes', 'enabled');
|
||||
|
||||
if ($enabled === true || $enabled === 'transitional') {
|
||||
|
||||
// XXX: loads constants
|
||||
|
||||
$inbox = new Notice_inbox();
|
||||
|
@ -941,7 +936,6 @@ class Notice extends Memcached_DataObject
|
|||
$inbox = new Notice_inbox();
|
||||
$inbox->query($qry);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -977,11 +971,6 @@ class Notice extends Memcached_DataObject
|
|||
{
|
||||
$groups = array();
|
||||
|
||||
$enabled = common_config('inboxes', 'enabled');
|
||||
if ($enabled !== true && $enabled !== 'transitional') {
|
||||
return $groups;
|
||||
}
|
||||
|
||||
/* extract all !group */
|
||||
$count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/',
|
||||
strtolower($this->content),
|
||||
|
|
|
@ -227,11 +227,9 @@ class User extends Memcached_DataObject
|
|||
}
|
||||
}
|
||||
|
||||
$inboxes = common_config('inboxes', 'enabled');
|
||||
// This flag is ignored but still set to 1
|
||||
|
||||
if ($inboxes === true || $inboxes == 'transitional') {
|
||||
$user->inboxed = 1;
|
||||
}
|
||||
|
||||
$user->created = common_sql_now();
|
||||
$user->uri = common_user_uri($user);
|
||||
|
@ -433,56 +431,17 @@ class User extends Memcached_DataObject
|
|||
|
||||
function noticesWithFriends($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 ' .
|
||||
'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,
|
||||
$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, true);
|
||||
|
||||
return Notice::getStreamByIds($ids);
|
||||
}
|
||||
}
|
||||
|
||||
function blowFavesCache()
|
||||
{
|
||||
|
@ -752,12 +711,9 @@ class User extends Memcached_DataObject
|
|||
'Remember_me',
|
||||
'Foreign_link',
|
||||
'Invitation',
|
||||
'Notice_inbox',
|
||||
);
|
||||
|
||||
if (common_config('inboxes', 'enabled')) {
|
||||
$related[] = 'Notice_inbox';
|
||||
}
|
||||
|
||||
foreach ($related as $cls) {
|
||||
$inst = new $cls();
|
||||
$inst->user_id = $this->id;
|
||||
|
|
|
@ -157,7 +157,7 @@ $default =
|
|||
'ping' =>
|
||||
array('notify' => array()),
|
||||
'inboxes' =>
|
||||
array('enabled' => true), # on by default for new sites
|
||||
array('enabled' => true), # ignored after 0.9.x
|
||||
'newuser' =>
|
||||
array('default' => null,
|
||||
'welcome' => null),
|
||||
|
|
Loading…
Reference in New Issue
Block a user