bridgev2/provisioning: allow group creation to signal failed participants

This commit is contained in:
Tulir Asokan 2025-10-21 17:20:22 +03:00
commit 8ee8fb1a20
2 changed files with 11 additions and 0 deletions

View file

@ -732,6 +732,13 @@ type CreateChatResponse struct {
// If a start DM request (CreateChatWithGhost or ResolveIdentifier) returns the DM to a different user,
// this field should have the user ID of said different user.
DMRedirectedTo networkid.UserID
FailedParticipants map[networkid.UserID]CreateChatFailedParticipant
}
type CreateChatFailedParticipant struct {
Reason string `json:"reason"`
InviteContent *event.Content `json:"invite_content,omitempty"`
}
// IdentifierResolvingNetworkAPI is an optional interface that network connectors can implement to support starting new direct chats.

View file

@ -22,6 +22,8 @@ type RespCreateGroup struct {
ID networkid.PortalID `json:"id"`
MXID id.RoomID `json:"mxid"`
Portal *bridgev2.Portal `json:"-"`
FailedParticipants map[networkid.UserID]bridgev2.CreateChatFailedParticipant `json:"failed_participants,omitempty"`
}
func CreateGroup(ctx context.Context, login *bridgev2.UserLogin, params *bridgev2.GroupCreateParams) (*RespCreateGroup, error) {
@ -109,5 +111,7 @@ func CreateGroup(ctx context.Context, login *bridgev2.UserLogin, params *bridgev
ID: resp.Portal.ID,
MXID: resp.Portal.MXID,
Portal: resp.Portal,
FailedParticipants: resp.FailedParticipants,
}, nil
}