From 2485143e2062e47425045423d7957a4f44de3e84 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Thu, 2 Feb 2023 12:00:49 +0400 Subject: [PATCH] Fix image fields (#3121) * fix: image fields --- VERSION | 2 +- protocol/common/message.go | 28 ++-- protocol/message_persistence.go | 34 ++--- protocol/messenger.go | 10 +- protocol/messenger_share_image_test.go | 3 + protocol/protobuf/chat_message.pb.go | 188 ++++++++++++++----------- protocol/protobuf/chat_message.proto | 3 + 7 files changed, 145 insertions(+), 123 deletions(-) diff --git a/VERSION b/VERSION index 616c9052e..61700993a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.126.2 +0.128.0 \ No newline at end of file diff --git a/protocol/common/message.go b/protocol/common/message.go index 6576f1b0f..c70c87cec 100644 --- a/protocol/common/message.go +++ b/protocol/common/message.go @@ -167,17 +167,11 @@ type Message struct { AudioPath string `json:"audioPath,omitempty"` // ImageLocalURL is the local url of the image ImageLocalURL string `json:"imageLocalUrl,omitempty"` - // AlbumID for a collage of images - AlbumID string `json:"albumId,omitempty"` // AudioLocalURL is the local url of the audio AudioLocalURL string `json:"audioLocalUrl,omitempty"` // StickerLocalURL is the local url of the sticker StickerLocalURL string `json:"stickerLocalUrl,omitempty"` - // Image dimensions - ImageWidth uint32 `json:"imageWidth,omitempty"` - ImageHeight uint32 `json:"imageHeight,omitempty"` - // CommunityID is the id of the community to advertise CommunityID string `json:"communityId,omitempty"` @@ -293,9 +287,6 @@ func (m *Message) MarshalJSON() ([]byte, error) { EnsName: m.EnsName, DisplayName: m.DisplayName, Image: m.ImageLocalURL, - AlbumID: m.AlbumID, - ImageWidth: m.ImageWidth, - ImageHeight: m.ImageHeight, Audio: m.AudioLocalURL, CommunityID: m.CommunityID, Timestamp: m.Timestamp, @@ -334,6 +325,12 @@ func (m *Message) MarshalJSON() ([]byte, error) { item.AudioDurationMs = audio.DurationMs } + if image := m.GetImage(); image != nil { + item.AlbumID = image.AlbumId + item.ImageWidth = image.Width + item.ImageHeight = image.Height + } + if discordMessage := m.GetDiscordMessage(); discordMessage != nil { item.DiscordMessage = discordMessage } @@ -353,6 +350,9 @@ func (m *Message) UnmarshalJSON(data []byte) error { AudioDurationMs uint64 `json:"audioDurationMs"` ParsedText json.RawMessage `json:"parsedText"` ContentType protobuf.ChatMessage_ContentType `json:"contentType"` + AlbumID string `json:"albumId"` + ImageWidth uint32 `json:"imageWidth"` + ImageHeight uint32 `json:"imageHeight"` }{ Alias: (*Alias)(m), } @@ -367,6 +367,16 @@ func (m *Message) UnmarshalJSON(data []byte) error { Audio: &protobuf.AudioMessage{DurationMs: aux.AudioDurationMs}, } } + + if aux.ContentType == protobuf.ChatMessage_IMAGE { + m.Payload = &protobuf.ChatMessage_Image{ + Image: &protobuf.ImageMessage{ + AlbumId: aux.AlbumID, + Width: aux.ImageWidth, + Height: aux.ImageHeight}, + } + } + m.ResponseTo = aux.ResponseTo m.EnsName = aux.EnsName m.DisplayName = aux.DisplayName diff --git a/protocol/message_persistence.go b/protocol/message_persistence.go index 9b21760f4..13ce13c7b 100644 --- a/protocol/message_persistence.go +++ b/protocol/message_persistence.go @@ -207,9 +207,6 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message var alias sql.NullString var identicon sql.NullString var communityID sql.NullString - var albumID sql.NullString - var imageWidth sql.NullInt32 - var imageHeight sql.NullInt32 var gapFrom sql.NullInt64 var gapTo sql.NullInt64 var editedAt sql.NullInt64 @@ -254,9 +251,9 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message &sticker.Hash, &image.Payload, &image.Type, - &message.AlbumID, - &message.ImageWidth, - &message.ImageHeight, + &image.AlbumId, + &image.Width, + &image.Height, &audio.DurationMs, &communityID, &serializedMentions, @@ -374,22 +371,11 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message To: uint32(gapTo.Int64), } } + if communityID.Valid { message.CommunityID = communityID.String } - if albumID.Valid { - message.AlbumID = albumID.String - } - - if imageWidth.Valid { - message.ImageWidth = uint32(imageWidth.Int32) - } - - if imageHeight.Valid { - message.ImageHeight = uint32(imageHeight.Int32) - } - if serializedMentions != nil { err := json.Unmarshal(serializedMentions, &message.Mentions) if err != nil { @@ -419,11 +405,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message message.CommandParameters = command case protobuf.ChatMessage_IMAGE: - img := protobuf.ImageMessage{ - Payload: image.Payload, - Type: image.Type, - } - message.Payload = &protobuf.ChatMessage_Image{Image: &img} + message.Payload = &protobuf.ChatMessage_Image{Image: image} case protobuf.ChatMessage_DISCORD_MESSAGE: message.Payload = &protobuf.ChatMessage_DiscordMessage{ @@ -507,9 +489,9 @@ func (db sqlitePersistence) tableUserMessagesAllValues(message *common.Message) sticker.Hash, image.Payload, image.Type, - message.AlbumID, - message.ImageWidth, - message.ImageHeight, + image.AlbumId, + image.Width, + image.Height, message.Base64Image, audio.Payload, audio.Type, diff --git a/protocol/messenger.go b/protocol/messenger.go index f5898f7d3..4b90b7116 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -2006,12 +2006,10 @@ func (m *Messenger) sendChatMessage(ctx context.Context, message *common.Message if err != nil { return nil, err } - - image := protobuf.ImageMessage{ - Payload: payload, - Type: images.ImageType(payload), - } - message.Payload = &protobuf.ChatMessage_Image{Image: &image} + imageMessage := message.GetImage() + imageMessage.Payload = payload + imageMessage.Type = images.ImageType(payload) + message.Payload = &protobuf.ChatMessage_Image{Image: imageMessage} } else if len(message.CommunityID) != 0 { community, err := m.communitiesManager.GetByIDString(message.CommunityID) diff --git a/protocol/messenger_share_image_test.go b/protocol/messenger_share_image_test.go index bd12661d2..d9300067d 100644 --- a/protocol/messenger_share_image_test.go +++ b/protocol/messenger_share_image_test.go @@ -87,6 +87,9 @@ func buildImageMessage(s *MessengerShareMessageSuite, chat Chat) *common.Message image := protobuf.ImageMessage{ Payload: payload, Type: protobuf.ImageType_JPEG, + AlbumId: "some-album-id", + Width: 1200, + Height: 1000, } message.Payload = &protobuf.ChatMessage_Image{Image: &image} return message diff --git a/protocol/protobuf/chat_message.pb.go b/protocol/protobuf/chat_message.pb.go index a2bda90b0..080614f92 100644 --- a/protocol/protobuf/chat_message.pb.go +++ b/protocol/protobuf/chat_message.pb.go @@ -161,6 +161,9 @@ func (m *StickerMessage) GetPack() int32 { type ImageMessage struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` Type ImageType `protobuf:"varint,2,opt,name=type,proto3,enum=protobuf.ImageType" json:"type,omitempty"` + AlbumId string `protobuf:"bytes,3,opt,name=album_id,json=albumId,proto3" json:"album_id,omitempty"` + Width uint32 `protobuf:"varint,4,opt,name=width,proto3" json:"width,omitempty"` + Height uint32 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -205,6 +208,27 @@ func (m *ImageMessage) GetType() ImageType { return ImageType_UNKNOWN_IMAGE_TYPE } +func (m *ImageMessage) GetAlbumId() string { + if m != nil { + return m.AlbumId + } + return "" +} + +func (m *ImageMessage) GetWidth() uint32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *ImageMessage) GetHeight() uint32 { + if m != nil { + return m.Height + } + return 0 +} + type AudioMessage struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` Type AudioMessage_AudioType `protobuf:"varint,2,opt,name=type,proto3,enum=protobuf.AudioMessage_AudioType" json:"type,omitempty"` @@ -833,7 +857,6 @@ type ChatMessage struct { // The type of the content of the message ContentType ChatMessage_ContentType `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3,enum=protobuf.ChatMessage_ContentType" json:"content_type,omitempty"` // Types that are valid to be assigned to Payload: - // // *ChatMessage_Sticker // *ChatMessage_Image // *ChatMessage_Audio @@ -1124,84 +1147,87 @@ func init() { } var fileDescriptor_263952f55fd35689 = []byte{ - // 1258 bytes of a gzipped FileDescriptorProto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6d, 0x73, 0xca, 0x2c, 0x8e, 0xc7, 0xfa, 0x64, 0xa4, 0x34, 0x50, 0x1f, 0x1e, - 0x5b, 0xe7, 0x96, 0x6d, 0x8c, 0x9d, 0xb1, 0x61, 0x59, 0xfa, 0xa9, 0xb1, 0xf5, 0x76, 0x86, 0xcd, - 0x37, 0xba, 0x6d, 0x38, 0xa7, 0x78, 0x3a, 0x3b, 0x53, 0x9a, 0xcc, 0x9a, 0x39, 0xd6, 0x4f, 0x0d, - 0xa5, 0xc5, 0x8e, 0xfc, 0xe9, 0xa7, 0xb4, 0xd1, 0x21, 0x48, 0xcc, 0xd8, 0x6c, 0x62, 0xda, 0xe7, - 0x8a, 0xc4, 0x1e, 0x87, 0x3b, 0xe6, 0x4e, 0xf5, 0x33, 0x05, 0xd0, 0x0d, 0x38, 0x62, 0x76, 0xf5, - 0xa1, 0xed, 0x60, 0xe3, 0xf5, 0xcc, 0xb0, 0x6c, 0x45, 0x66, 0xcc, 0x91, 0x69, 0x0d, 0xa7, 0x78, - 0x24, 0xa4, 0x95, 0x0e, 0xba, 0x03, 0xb7, 0xcc, 0x91, 0x31, 0xb1, 0x4d, 0xfb, 0xdc, 0x79, 0x63, - 0x60, 0xf3, 0x85, 0x39, 0xd4, 0x59, 0xcc, 0xca, 0xe1, 0x89, 0xb4, 0x5d, 0x5d, 0xda, 0x0c, 0x8e, - 0xf7, 0x21, 0x7e, 0x0f, 0xa4, 0xbc, 0x90, 0xe9, 0xfb, 0x38, 0x67, 0x5c, 0xbf, 0xa2, 0x4e, 0x0e, - 0x7f, 0x92, 0x07, 0x5f, 0x7c, 0x23, 0xaa, 0xfe, 0xb6, 0xc9, 0x4f, 0x5f, 0xfe, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x4b, 0x69, 0x87, 0xa8, 0x3a, 0x0c, 0x00, 0x00, + // 1302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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0x42, 0xec, 0x55, 0xe4, 0x04, 0x09, 0x83, + 0x2d, 0x9c, 0x08, 0xe8, 0x05, 0xb4, 0x84, 0x13, 0x67, 0xa7, 0xce, 0xd9, 0xb9, 0xbd, 0x65, 0x27, + 0x05, 0xc8, 0x29, 0x91, 0x97, 0x5b, 0x01, 0x0d, 0xa1, 0xe5, 0x86, 0x01, 0x25, 0x01, 0x4d, 0x3c, + 0x1b, 0xdc, 0xf3, 0xf1, 0xd6, 0x73, 0x30, 0x77, 0x44, 0x7a, 0xfd, 0x41, 0x62, 0x99, 0x44, 0x71, + 0xb7, 0x82, 0xf6, 0x67, 0x09, 0xda, 0x43, 0xb2, 0x20, 0x94, 0xdc, 0xcc, 0x44, 0x2e, 0xeb, 0xf2, + 0x0d, 0x59, 0x57, 0xf6, 0x66, 0x5d, 0xbd, 0x29, 0xeb, 0xda, 0x07, 0x67, 0xfd, 0x00, 0xc0, 0xe3, + 0x70, 0x3d, 0xfb, 0x62, 0xc3, 0xd9, 0x92, 0xb0, 0x94, 0x6a, 0x4e, 0x36, 0x9a, 0x09, 0x28, 0xc9, + 0xe6, 0x65, 0x18, 0x8d, 0xde, 0x93, 0x52, 0x11, 0x79, 0x79, 0x07, 0xb9, 0xf6, 0x57, 0x19, 0x3a, + 0x43, 0x3f, 0x76, 0xc3, 0xc8, 0x13, 0x71, 0x3a, 0x50, 0xf6, 0xbd, 0xf4, 0xc0, 0x96, 0x7d, 0x8f, + 0xb7, 0x87, 0x68, 0x69, 0x29, 0x6d, 0xd8, 0xfb, 0x20, 0x51, 0x7f, 0x49, 0x62, 0xea, 0x2c, 0x57, + 0x82, 0x8e, 0x4c, 0x81, 0x7a, 0x70, 0x98, 0x09, 0xac, 0xfd, 0x88, 0x68, 0x94, 0x5d, 0x35, 0x3b, + 0x48, 0x69, 0x9d, 0x38, 0x3b, 0x12, 0x16, 0x22, 0xfa, 0x1c, 0xea, 0xce, 0x9a, 0xce, 0xc3, 0x88, + 0xa7, 0x2f, 0x3f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x00, 0xff, 0xff, 0x5b, 0x61, + 0xf8, 0x08, 0x84, 0x0c, 0x00, 0x00, } diff --git a/protocol/protobuf/chat_message.proto b/protocol/protobuf/chat_message.proto index ac461f02f..6c2a38b2f 100644 --- a/protocol/protobuf/chat_message.proto +++ b/protocol/protobuf/chat_message.proto @@ -13,6 +13,9 @@ message StickerMessage { message ImageMessage { bytes payload = 1; ImageType type = 2; + string album_id = 3; + uint32 width = 4; + uint32 height = 5; } message AudioMessage {