feat: add images count to reply (#3574)

* feat: add images count to reply
This commit is contained in:
Omar Basem 2023-06-06 15:52:07 +04:00 committed by GitHub
parent bf29188b2d
commit 1d4fa29f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -1 +1 @@
0.154.9 0.155.1

View File

@ -31,9 +31,10 @@ type QuotedMessage struct {
ID string `json:"id"` ID string `json:"id"`
ContentType int64 `json:"contentType"` ContentType int64 `json:"contentType"`
// From is a public key of the author of the message. // From is a public key of the author of the message.
From string `json:"from"` From string `json:"from"`
Text string `json:"text"` Text string `json:"text"`
ParsedText json.RawMessage `json:"parsedText,omitempty"` ParsedText json.RawMessage `json:"parsedText,omitempty"`
AlbumImagesCount int64 `json:"albumImagesCount"`
// ImageLocalURL is the local url of the image // ImageLocalURL is the local url of the image
ImageLocalURL string `json:"image,omitempty"` ImageLocalURL string `json:"image,omitempty"`
// AudioLocalURL is the local url of the audio // AudioLocalURL is the local url of the audio

View File

@ -176,6 +176,7 @@ func (db sqlitePersistence) tableUserMessagesAllFieldsJoin() string {
m2.source, m2.source,
m2.text, m2.text,
m2.parsed_text, m2.parsed_text,
m2.album_images_count,
m2.audio_duration_ms, m2.audio_duration_ms,
m2.community_id, m2.community_id,
m2.id, m2.id,
@ -203,6 +204,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
var ContentType sql.NullInt64 var ContentType sql.NullInt64
var quotedText sql.NullString var quotedText sql.NullString
var quotedParsedText []byte var quotedParsedText []byte
var quotedAlbumImagesCount sql.NullInt64
var quotedFrom sql.NullString var quotedFrom sql.NullString
var quotedAudioDuration sql.NullInt64 var quotedAudioDuration sql.NullInt64
var quotedCommunityID sql.NullString var quotedCommunityID sql.NullString
@ -309,6 +311,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
&quotedFrom, &quotedFrom,
&quotedText, &quotedText,
&quotedParsedText, &quotedParsedText,
&quotedAlbumImagesCount,
&quotedAudioDuration, &quotedAudioDuration,
&quotedCommunityID, &quotedCommunityID,
&quotedID, &quotedID,
@ -360,13 +363,14 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
} }
} else { } else {
message.QuotedMessage = &common.QuotedMessage{ message.QuotedMessage = &common.QuotedMessage{
ID: quotedID.String, ID: quotedID.String,
ContentType: ContentType.Int64, ContentType: ContentType.Int64,
From: quotedFrom.String, From: quotedFrom.String,
Text: quotedText.String, Text: quotedText.String,
ParsedText: quotedParsedText, ParsedText: quotedParsedText,
CommunityID: quotedCommunityID.String, AlbumImagesCount: quotedAlbumImagesCount.Int64,
Deleted: quotedDeleted.Bool, CommunityID: quotedCommunityID.String,
Deleted: quotedDeleted.Bool,
} }
if message.QuotedMessage.ContentType == int64(protobuf.ChatMessage_DISCORD_MESSAGE) { if message.QuotedMessage.ContentType == int64(protobuf.ChatMessage_DISCORD_MESSAGE) {
message.QuotedMessage.DiscordMessage = quotedDiscordMessage message.QuotedMessage.DiscordMessage = quotedDiscordMessage