This is due to the MakeJoin and SendJoin functions returning pointer-less responses. To work around this, one must do something like the following:
type internalJoinClient struct {
upstream fclient.FederationClient
}
func (c *internalJoinClient) MakeJoin(ctx context.Context, origin spec.ServerName, via spec.ServerName, roomId string, userId string) (gomatrixserverlib.MakeJoinResponse, error) {
res, err := c.upstream.MakeJoin(ctx, origin, via, roomId, userId)
return &res, err
}
func (c *internalJoinClient) SendJoin(ctx context.Context, origin spec.ServerName, via spec.ServerName, event gomatrixserverlib.PDU) (gomatrixserverlib.SendJoinResponse, error) {
res, err := c.upstream.SendJoin(ctx, origin, via, event)
return &res, err
}
then, the PerformJoin function can be used as such:
client := fclient.NewFederationClient( /* ... */ ) // or wherever you get your client from
join, err := gomatrixserverlib.PerformJoin(ctx, &internalJoinClient{upstream: client}, gomatrixserverlib.PerformJoinInput{ /* ... */ })
// etc
This is due to the
MakeJoinandSendJoinfunctions returning pointer-less responses. To work around this, one must do something like the following:then, the
PerformJoinfunction can be used as such: