Add a way to filter users that were moved to other instances

main
Bofh 5 months ago
parent f09df04fd3
commit b0c912a300

@ -53,6 +53,7 @@ $sql_all = '
{noStatusesWhere}
{olderThanNDays}
{newerThanNDays}
{movedToAccount}
a.suspended_at IS NULL
ORDER BY a.updated_at DESC
{lastNActiveUsers}
@ -131,6 +132,10 @@ if (isset($_GET['no_statuses']))
$sql_all = str_replace('{noStatusesWhere}', '(SELECT count(1) FROM statuses WHERE account_id = a.id) = 0 AND', $sql_all);
else $sql_all = str_replace('{noStatusesWhere}', '', $sql_all);
if (isset($_GET['is_moved']))
$sql_all = str_replace('{movedToAccount}', 'NOT moved_to_account_id IS NULL AND', $sql_all);
else $sql_all = str_replace('{movedToAccount}', '', $sql_all);
$last_n_active = null;
if (isset($_GET['last_n_active'])) {
@ -269,6 +274,15 @@ if (isset($_GET['profile']) && trim($_GET['profile']) != '')
if ($enable_caching && !$match_cache_exists)
content_cache__put($match_ckey, 'ondemand,3600', $match_data);
}
else
{
$i = -1;
foreach ($all_accounts as $account) {
$i++;
$filtered_accounts []= $account['id'];
$filtered_accounts_index[$account['id']] = $i;
}
}
$config = instance_config('mastodon');
$filtered_accounts = array_unique($filtered_accounts);

@ -71,6 +71,9 @@
<input type="checkbox" id="account-prop-nofollows"
name="no_follows" value="1"
/><label for="account-prop-nofollows">No follows</label>
<input type="checkbox" id="account-prop-ismoved"
name="is_moved" value="1"
/><label for="account-prop-ismoved">Has moved elsewhere</label>
</div>
<div class="input">
<label>Last activity (days):</label>

@ -201,6 +201,9 @@ window.view.instance = {
const obj_nofollows = E.element('*[name=no_follows]:checked');
if (obj_nofollows !== null)
data.no_follows = '';
const obj_ismoved = E.element('*[name=is_moved]:checked');
if (obj_ismoved !== null)
data.is_moved = '';
var olderThan = E.element('#filters-current input[name=older_than_days]').value;
if (olderThan !== '') {
olderThan = Number.parseInt(olderThan);
@ -255,6 +258,7 @@ window.view.instance = {
if (d.no_avatar !== undefined) E.element('#filters-current input[name=no_avatar]').click();
if (d.no_statuses !== undefined) E.element('#filters-current input[name=no_statuses]').click();
if (d.no_follows !== undefined) E.element('#filters-current input[name=no_follows]').click();
if (d.is_moved !== undefined) E.element('#filters-current input[name=is_moved]').click();
E.element('#filters-current input[name=older_than_days]').value = NaN;
E.element('#filters-current input[name=newer_than_days]').value = NaN;
if (d.older_than_days !== undefined)

Loading…
Cancel
Save