Don't display posts of disabled user on their profile

This commit is contained in:
Alex Gleason
2024-06-19 14:02:43 -05:00
parent 8bd67720d6
commit 003d60c959
5 changed files with 11 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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);
}