[mentions] ParsedText in quoted message

ParsedText is needed to properly display mention in quoted message.
This commit is contained in:
Roman Volosovskyi 2020-09-09 14:03:29 +03:00
parent 32b0af8ecc
commit 57728224d4
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
3 changed files with 8 additions and 3 deletions

View File

@ -1 +1 @@
0.60.1
0.60.2

View File

@ -21,6 +21,7 @@ type QuotedMessage struct {
// 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"`
// Base64Image is the converted base64 image
Base64Image string `json:"image,omitempty"`
// Base64Audio is the converted base64 audio

View File

@ -88,6 +88,7 @@ func (db sqlitePersistence) tableUserMessagesAllFieldsJoin() string {
m1.response_to,
m2.source,
m2.text,
m2.parsed_text,
m2.image_base64,
m2.audio_duration_ms,
m2.audio_base64,
@ -105,6 +106,7 @@ type scanner interface {
func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message *Message, others ...interface{}) error {
var quotedText sql.NullString
var quotedParsedText []byte
var quotedFrom sql.NullString
var quotedImage sql.NullString
var quotedAudio sql.NullString
@ -150,6 +152,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
&message.ResponseTo,
&quotedFrom,
&quotedText,
&quotedParsedText,
&quotedImage,
&quotedAudioDuration,
&quotedAudio,
@ -165,6 +168,7 @@ func (db sqlitePersistence) tableUserMessagesScanAllFields(row scanner, message
message.QuotedMessage = &QuotedMessage{
From: quotedFrom.String,
Text: quotedText.String,
ParsedText: quotedParsedText,
Base64Image: quotedImage.String,
AudioDurationMs: uint64(quotedAudioDuration.Int64),
Base64Audio: quotedAudio.String,