Fix getImageMessageMIME() bug

This commit is contained in:
Samuel Hawksby-Robinson 2020-10-22 17:18:10 +01:00 committed by Andrea Maria Piana
parent 8ec0ec4341
commit 6bab64cc9b
1 changed files with 4 additions and 4 deletions

View File

@ -358,13 +358,13 @@ func (m *Message) PrepareContent() error {
func getImageMessageMIME(i *protobuf.ImageMessage) (string, error) {
switch i.Type {
case protobuf.ImageMessage_PNG:
case protobuf.ImageType_PNG:
return "png", nil
case protobuf.ImageMessage_JPEG:
case protobuf.ImageType_JPEG:
return "jpeg", nil
case protobuf.ImageMessage_WEBP:
case protobuf.ImageType_WEBP:
return "webp", nil
case protobuf.ImageMessage_GIF:
case protobuf.ImageType_GIF:
return "gif", nil
}
return "", errors.New("image format not supported")