func SendInvite(
	ctx context.Context,
	rsAPI RoomserverInternalAPI, inviteEvent gomatrixserverlib.HeaderedEvent,
	inviteRoomState []gomatrixserverlib.InviteV2StrippedState,
	sendAsServer gomatrixserverlib.ServerName, txnID *TransactionID,
) error {
	// Start by sending the invite request into the roomserver. This will
	// trigger the federation request amongst other things if needed.
	request := &PerformInviteRequest{
		Event:           inviteEvent,
		InviteRoomState: inviteRoomState,
		RoomVersion:     inviteEvent.RoomVersion,
		SendAsServer:    string(sendAsServer),
		TransactionID:   txnID,
	}
	response := &PerformInviteResponse{}
	if err := rsAPI.PerformInvite(ctx, request, response); err != nil {
		return fmt.Errorf("rsAPI.PerformInvite: %w", err)
	}
	if response.Error != nil {
		return response.Error
	}

	return nil
}
// SendInvite event to the roomserver.
// This should only be needed for invite events that occur outside of a known room.
// If we are in the room then the event should be sent using the SendEvents method.
SendInvite event to the roomserver.
This should only be needed for invite events that occur outside of a known room.
If we are in the room then the event should be sent using the SendEvents method.
// SendInvite event to the roomserver . // This should only be needed for invite events that occur outside of a known room . // If we are in the room then the event should be sent using the SendEvents method .
func SendInvite(
	ctx context.Context,
	rsAPI RoomserverInternalAPI, inviteEvent gomatrixserverlib.HeaderedEvent,
	inviteRoomState []gomatrixserverlib.InviteV2StrippedState,
	sendAsServer gomatrixserverlib.ServerName, txnID *TransactionID,
) error {
	request := &PerformInviteRequest{
		Event:           inviteEvent,
		InviteRoomState: inviteRoomState,
		RoomVersion:     inviteEvent.RoomVersion,
		SendAsServer:    string(sendAsServer),
		TransactionID:   txnID,
	}
	response := &PerformInviteResponse{}
	if err := rsAPI.PerformInvite(ctx, request, response); err != nil {
		return fmt.Errorf("rsAPI.PerformInvite: %w", err)
	}
	if response.Error != nil {
		return response.Error
	}
	return nil
}
func SendInvite ( ctx context . Context , rsAPI RoomserverInternalAPI , inviteEvent gomatrixserverlib . HeaderedEvent , inviteRoomState [ ] gomatrixserverlib . InviteV2StrippedState , sendAsServer gomatrixserverlib . ServerName , txnID * TransactionID , ) error { request := & PerformInviteRequest { Event : inviteEvent , InviteRoomState : inviteRoomState , RoomVersion : inviteEvent . RoomVersion , SendAsServer : string ( sendAsServer ) , TransactionID : txnID , } response := & PerformInviteResponse { } if err := rsAPI . PerformInvite ( ctx , request , response ) ; err != nil { return fmt . Errorf ( " " , err ) } if response . Error != nil { return response . Error } return nil }
SendInvite event to the roomserver.
SendInvite event to the roomserver .
// Start by sending the invite request into the roomserver. This will // trigger the federation request amongst other things if needed.