diff options
Diffstat (limited to 'appservice/account.go')
-rw-r--r-- | appservice/account.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/appservice/account.go b/appservice/account.go index a2b95d7..2df2930 100644 --- a/appservice/account.go +++ b/appservice/account.go @@ -137,7 +137,10 @@ func (a *Account) userInfoUpdatedInternal(user UserID, info *UserInfo) error { } if info.Avatar != nil { - err = fmt.Errorf("Avatar: not implemented") + err2 := mx.ProfileAvatar(mx_user_id, info.Avatar) + if err2 != nil { + err = err2 + } } return err @@ -182,8 +185,10 @@ func (a *Account) roomInfoUpdatedInternal(roomId RoomID, author UserID, info *Ro } if info.Picture != nil { - // TODO - err = fmt.Errorf("Picture: not implemented") + err2 := mx.RoomAvatarAs(mx_room_id, info.Picture, as_mxid) + if err2 != nil { + err = err2 + } } return err @@ -254,8 +259,8 @@ func (a *Account) eventInternal(event *Event) error { return err } - if event.Attachements != nil { - for _, file := range event.Attachements { + if event.Attachments != nil { + for _, file := range event.Attachments { mxfile, err := mx.UploadMedia(file) if err != nil { return err @@ -270,8 +275,8 @@ func (a *Account) eventInternal(event *Event) error { content["info"] = map[string]interface{} { "mimetype": mxfile.Mimetype(), "size": mxfile.Size(), - "width": sz.Width, - "height": sz.Height, + "w": sz.Width, + "h": sz.Height, } } else { content["msgtype"] = "m.file" |