feat(service): Remove thumbnail data on retraction
This commit is contained in:
parent
259e0dacd0
commit
9203905ed8
@ -418,6 +418,7 @@ class DatabaseService {
|
||||
Object? originId = notSpecified,
|
||||
Object? sid = notSpecified,
|
||||
bool? isRetracted,
|
||||
Object? thumbnailData = notSpecified,
|
||||
}) async {
|
||||
final md = (await _db.query(
|
||||
'Messages',
|
||||
@ -490,6 +491,9 @@ class DatabaseService {
|
||||
if (isRetracted != null) {
|
||||
m['isRetracted'] = boolToInt(isRetracted);
|
||||
}
|
||||
if (thumbnailData != notSpecified) {
|
||||
m['thumbnailData'] = thumbnailData as String?;
|
||||
}
|
||||
|
||||
await _db.update(
|
||||
'Messages',
|
||||
|
@ -617,6 +617,7 @@ Future<void> performMessageRetraction(RetractMessageComment command, { dynamic e
|
||||
mediaHeight: null,
|
||||
mediaSize: null,
|
||||
isRetracted: true,
|
||||
thumbnailData: null,
|
||||
);
|
||||
sendEvent(MessageUpdatedEvent(message: retractedMessage));
|
||||
|
||||
|
@ -142,6 +142,7 @@ class MessageService {
|
||||
bool? isDownloading,
|
||||
Object? originId = notSpecified,
|
||||
Object? sid = notSpecified,
|
||||
Object? thumbnailData = notSpecified,
|
||||
bool? isRetracted,
|
||||
}) async {
|
||||
final newMessage = await GetIt.I.get<DatabaseService>().updateMessage(
|
||||
@ -168,6 +169,7 @@ class MessageService {
|
||||
sid: sid,
|
||||
isRetracted: isRetracted,
|
||||
isMedia: isMedia,
|
||||
thumbnailData: thumbnailData,
|
||||
);
|
||||
|
||||
if (_messageCache.containsKey(newMessage.conversationJid)) {
|
||||
|
@ -785,6 +785,7 @@ class XmppService {
|
||||
mediaHeight: null,
|
||||
mediaSize: null,
|
||||
isRetracted: true,
|
||||
thumbnailData: null,
|
||||
);
|
||||
sendEvent(MessageUpdatedEvent(message: retractedMessage));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user