mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-17 04:14:25 +01:00
Don't display posts of disabled user on their profile
This commit is contained in:
@@ -180,6 +180,13 @@ const accountStatusesController: AppController = async (c) => {
|
||||
|
||||
const store = await Storages.db();
|
||||
|
||||
const [user] = await store.query([{ kinds: [30382], authors: [Conf.pubkey], '#d': [pubkey], limit: 1 }], { signal });
|
||||
const names = getTagSet(user?.tags, 'n');
|
||||
|
||||
if (names.has('disabled')) {
|
||||
return c.json([]);
|
||||
}
|
||||
|
||||
if (pinned) {
|
||||
const [pinEvent] = await store.query([{ kinds: [10001], authors: [pubkey], limit: 1 }], { signal });
|
||||
if (pinEvent) {
|
||||
|
||||
@@ -146,6 +146,7 @@ const adminActionController: AppController = async (c) => {
|
||||
n.silenced = true;
|
||||
}
|
||||
if (data.type === 'suspend') {
|
||||
n.disabled = true;
|
||||
n.suspended = true;
|
||||
store.remove([{ authors: [authorId] }]).catch(console.warn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user