feat: reject messages which are too large

This commit is contained in:
James Houlahan
2021-01-12 15:51:14 +01:00
parent 4ffa62f6ca
commit 0679b99a65
5 changed files with 32 additions and 4 deletions

View File

@ -31,11 +31,11 @@ func (store *Store) GetSpace() (usedSpace, maxSpace uint, err error) {
return uint(apiUser.UsedSpace), uint(apiUser.MaxSpace), nil
}
// GetMaxUpload returns max size of attachment in bytes.
func (store *Store) GetMaxUpload() (uint, error) {
// GetMaxUpload returns max size of message + all attachments in bytes.
func (store *Store) GetMaxUpload() (int64, error) {
apiUser, err := store.client().CurrentUser()
if err != nil {
return 0, err
}
return uint(apiUser.MaxUpload), nil
return apiUser.MaxUpload, nil
}