mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-08 14:34:32 +02:00
Remove system.no_auto_update personal config key and assume default value of true
- By popular request, the behavior with false was too perturbating
This commit is contained in:
parent
dfcfae6bcc
commit
3b9bf4d70d
7 changed files with 40 additions and 44 deletions
|
@ -38,7 +38,7 @@ class Community extends CommunityModule
|
|||
$this->parseRequest();
|
||||
|
||||
$o = '';
|
||||
if (!empty($request['force']) || !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
|
||||
if (!empty($request['force'])) {
|
||||
$o = DI::conversation()->create(self::getItems(), 'community', true, false, 'commented', DI::userSession()->getLocalUserId());
|
||||
}
|
||||
|
||||
|
|
|
@ -41,43 +41,45 @@ class Network extends NetworkModule
|
|||
|
||||
$o = '';
|
||||
|
||||
if (!DI::pConfig()->get($profile_uid, 'system', 'no_auto_update') || ($request['force'] == 1)) {
|
||||
if (!empty($request['item'])) {
|
||||
$item = Post::selectFirst(['parent'], ['id' => $request['item']]);
|
||||
$parent = $item['parent'] ?? 0;
|
||||
} else {
|
||||
$parent = 0;
|
||||
}
|
||||
|
||||
$conditionFields = [];
|
||||
if (!empty($parent)) {
|
||||
// Load only a single thread
|
||||
$conditionFields['parent'] = $parent;
|
||||
} elseif (self::$order === 'received') {
|
||||
// Only load new toplevel posts
|
||||
$conditionFields['unseen'] = true;
|
||||
$conditionFields['gravity'] = Item::GRAVITY_PARENT;
|
||||
} else {
|
||||
// Load all unseen items
|
||||
$conditionFields['unseen'] = true;
|
||||
}
|
||||
|
||||
$params = ['limit' => 100];
|
||||
$table = 'network-item-view';
|
||||
|
||||
$items = self::getItems($table, $params, $conditionFields);
|
||||
|
||||
if (self::$order === 'received') {
|
||||
$ordering = '`received`';
|
||||
} elseif (self::$order === 'created') {
|
||||
$ordering = '`created`';
|
||||
} else {
|
||||
$ordering = '`commented`';
|
||||
}
|
||||
|
||||
$o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, DI::userSession()->getLocalUserId());
|
||||
if (empty($request['force'])) {
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
|
||||
if (!empty($request['item'])) {
|
||||
$item = Post::selectFirst(['parent'], ['id' => $request['item']]);
|
||||
$parent = $item['parent'] ?? 0;
|
||||
} else {
|
||||
$parent = 0;
|
||||
}
|
||||
|
||||
$conditionFields = [];
|
||||
if (!empty($parent)) {
|
||||
// Load only a single thread
|
||||
$conditionFields['parent'] = $parent;
|
||||
} elseif (self::$order === 'received') {
|
||||
// Only load new toplevel posts
|
||||
$conditionFields['unseen'] = true;
|
||||
$conditionFields['gravity'] = Item::GRAVITY_PARENT;
|
||||
} else {
|
||||
// Load all unseen items
|
||||
$conditionFields['unseen'] = true;
|
||||
}
|
||||
|
||||
$params = ['limit' => 100];
|
||||
$table = 'network-item-view';
|
||||
|
||||
$items = self::getItems($table, $params, $conditionFields);
|
||||
|
||||
if (self::$order === 'received') {
|
||||
$ordering = '`received`';
|
||||
} elseif (self::$order === 'created') {
|
||||
$ordering = '`created`';
|
||||
} else {
|
||||
$ordering = '`commented`';
|
||||
}
|
||||
|
||||
$o = DI::conversation()->create($items, 'network', $profile_uid, false, $ordering, DI::userSession()->getLocalUserId());
|
||||
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class Profile extends BaseModule
|
|||
|
||||
$o = '';
|
||||
|
||||
if (empty($request['force']) && DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update')) {
|
||||
if (empty($request['force'])) {
|
||||
System::htmlUpdateExit($o);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue