mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
appservice: ensure registered before uploading media
This commit is contained in:
parent
5d4407950a
commit
962ac6bf17
1 changed files with 14 additions and 0 deletions
|
|
@ -436,6 +436,20 @@ func (intent *IntentAPI) SetRoomTopic(ctx context.Context, roomID id.RoomID, top
|
|||
})
|
||||
}
|
||||
|
||||
func (intent *IntentAPI) UploadMedia(ctx context.Context, data mautrix.ReqUploadMedia) (*mautrix.RespMediaUpload, error) {
|
||||
if err := intent.EnsureRegistered(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return intent.Client.UploadMedia(ctx, data)
|
||||
}
|
||||
|
||||
func (intent *IntentAPI) UploadAsync(ctx context.Context, data mautrix.ReqUploadMedia) (*mautrix.RespCreateMXC, error) {
|
||||
if err := intent.EnsureRegistered(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return intent.Client.UploadAsync(ctx, data)
|
||||
}
|
||||
|
||||
func (intent *IntentAPI) SetDisplayName(ctx context.Context, displayName string) error {
|
||||
if err := intent.EnsureRegistered(ctx); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue