feat: relay dm_close and dm_reopen to federated peers
Queue dm_close relay in DELETE /api/dm/:id after broadcasting locally, and queue dm_reopen relay inside the myDm.closed === 1 branch of POST /api/dm so peers are notified only on actual reopen, not new DM creation.
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
appendMutationLog,
|
||||
queueOutboxEvent,
|
||||
queueDmRelay,
|
||||
queueDmCloseRelay,
|
||||
getDmParticipants,
|
||||
getGroupDmTargetOrigins,
|
||||
isFederationRelayEnabled,
|
||||
@@ -445,6 +446,9 @@ export async function dmRoutes(app: FastifyInstance): Promise<void> {
|
||||
eq(schema.dmMembers.userId, request.userId),
|
||||
))
|
||||
.run();
|
||||
|
||||
// Relay reopen to federated peers
|
||||
queueDmCloseRelay(myDm.dmChannelId, request.userId, 'dm_reopen');
|
||||
}
|
||||
|
||||
const dmMemberRows = db.select()
|
||||
@@ -854,6 +858,9 @@ export async function dmRoutes(app: FastifyInstance): Promise<void> {
|
||||
dmChannelId: id,
|
||||
});
|
||||
|
||||
// Relay close to federated peers
|
||||
queueDmCloseRelay(id, request.userId, 'dm_close');
|
||||
|
||||
return reply.code(200).send({ success: true });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user