mirror of
https://github.com/friendica/friendica
synced 2025-05-03 05:44:10 +02:00
Merge pull request #13611 from annando/languages
Use the post language for the language detection / config for quality
This commit is contained in:
commit
58e5f0d9c5
6 changed files with 101 additions and 25 deletions
|
@ -117,7 +117,7 @@ class Item
|
|||
const DELIVER_FIELDLIST = [
|
||||
'uid', 'id', 'parent', 'uri-id', 'uri', 'thr-parent', 'parent-uri', 'guid',
|
||||
'parent-guid', 'conversation', 'received', 'created', 'edited', 'verb', 'object-type', 'object', 'target',
|
||||
'private', 'title', 'body', 'raw-body', 'location', 'coord', 'app',
|
||||
'private', 'title', 'body', 'raw-body', 'language', 'location', 'coord', 'app',
|
||||
'inform', 'deleted', 'extid', 'post-type', 'post-reason', 'gravity',
|
||||
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
|
||||
'author-id', 'author-addr', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid',
|
||||
|
@ -1484,6 +1484,10 @@ class Item
|
|||
*/
|
||||
private static function setOwnerforResharedItem(array $item)
|
||||
{
|
||||
if ($item['uid'] == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parent = Post::selectFirst(
|
||||
['id', 'causer-id', 'owner-id', 'author-id', 'author-link', 'origin', 'post-reason'],
|
||||
['uri-id' => $item['thr-parent-id'], 'uid' => $item['uid']]
|
||||
|
|
|
@ -586,7 +586,14 @@ class User
|
|||
$languages = [];
|
||||
$uids = [];
|
||||
|
||||
$users = DBA::select('user', ['uid', 'language'], ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` > ?", 0]);
|
||||
$condition = ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` > ?", 0];
|
||||
|
||||
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
|
||||
if (!empty($abandon_days)) {
|
||||
$condition = DBA::mergeConditions($condition, ["`last-activity` > ?", DateTimeFormat::utc('now - ' . $abandon_days . ' days')]);
|
||||
}
|
||||
|
||||
$users = DBA::select('user', ['uid', 'language'], $condition);
|
||||
while ($user = DBA::fetch($users)) {
|
||||
$uids[] = $user['uid'];
|
||||
$code = DI::l10n()->toISO6391($user['language']);
|
||||
|
@ -612,6 +619,7 @@ class User
|
|||
}
|
||||
DBA::close($channels);
|
||||
|
||||
ksort($languages);
|
||||
return array_keys($languages);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue