fix: three code review issues — leaveGroup duplicate, as any casts, federation ownership fallback
- Remove redundant `leaveGroup` API method from client.ts (duplicated `leave`); update MessageList.tsx WelcomeHeader to call `api.dm.leave` directly - Add optional `type` field to shared `Message` interface so `MessageWithUser` carries it; remove `(msg as any).type` casts in `isSameGroup` and the render branch in MessageList.tsx - Fix `processOwnershipTransferEvent` in federation.ts: replace `channel.ownerId` fallbacks (pre-update, old owner) with `event.ownership.newOwner.homeUserId` in the db update, dm_owner_updated broadcast, and both system message content payloads
This commit is contained in:
@@ -145,7 +145,6 @@ export class BackspaceApiClient {
|
||||
deleteMessage: (id: string) => Promise<{ success: boolean }>;
|
||||
addMember: (dmChannelId: string, data: { userId: string }) => Promise<DmChannel>;
|
||||
leave: (dmChannelId: string) => Promise<{ success: boolean }>;
|
||||
leaveGroup: (dmChannelId: string) => Promise<{ success: boolean }>;
|
||||
};
|
||||
|
||||
readonly social: {
|
||||
@@ -506,8 +505,6 @@ export class BackspaceApiClient {
|
||||
request<DmChannel>('POST', `/dm/${dmChannelId}/members`, data),
|
||||
leave: (dmChannelId: string) =>
|
||||
request<{ success: boolean }>('DELETE', `/dm/${dmChannelId}/members`),
|
||||
leaveGroup: (dmChannelId: string) =>
|
||||
request<{ success: boolean }>('DELETE', `/dm/${dmChannelId}/members`),
|
||||
};
|
||||
|
||||
this.social = {
|
||||
|
||||
Reference in New Issue
Block a user