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"`
ContentType int64 `json:"contentType"`
// From is a public key of the author of the message.
From string `json:"from"`
Text string `json:"text"`
ParsedText json.RawMessage `json:"parsedText,omitempty"`
From string `json:"from"`
Text string `json:"text"`
ParsedText json.RawMessage `json:"parsedText,omitempty"`
AlbumImagesCount int64 `json:"albumImagesCount"`
// ImageLocalURL is the local url of the image
ImageLocalURL string `json:"image,omitempty"`
// AudioLocalURL is the local url of the audio

View File

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