Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions hasura/triggers/player_blocks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ BEGIN
WHERE dc.room_id = LEAST(_a, _b)::text || ':' || GREATEST(_a, _b)::text
AND dc.steam_id = _a;

-- Chat hides what the blocked player said from the blocker, so their bell
-- previews go the way NotificationsService.retractChatMessage takes them:
-- blanked as well, since a recipient can restore their own deleted rows,
-- and a push still waiting in its bundling window skips a deleted row.
UPDATE public.notifications n
SET deleted_at = COALESCE(n.deleted_at, now()),
message = ''
WHERE n.steam_id = _a
AND n.type IN ('ChatMessage', 'MatchChatMessage')
AND n.data->>'senderSteamId' = _b::text
AND (n.deleted_at IS NULL OR n.message <> '');

RETURN NULL;
END;
$$;
Expand Down
2 changes: 2 additions & 0 deletions src/chat/chat.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { loggerFactory } from "src/utilities/LoggerFactory";
import { getQueuesProcessors } from "src/utilities/QueueProcessors";
import { ChatController } from "./chat.controller";
import { NotificationsModule } from "src/notifications/notifications.module";
import { PlayerBlocksModule } from "src/player-blocks/player-blocks.module";
import { ChatQueues } from "./enums/ChatQueues";
import { PruneDirectMessages } from "./jobs/PruneDirectMessages";
import { BackfillDirectMessages } from "./jobs/BackfillDirectMessages";
Expand All @@ -24,6 +25,7 @@ import { BackfillDirectMessages } from "./jobs/BackfillDirectMessages";
PostgresModule,
forwardRef(() => RconModule),
NotificationsModule,
PlayerBlocksModule,
BullModule.registerQueue({
name: ChatQueues.ChatMaintenance,
}),
Expand Down
Loading
Loading