feat(service): Set isMedia to false when retracting

This commit is contained in:
PapaTutuWawa 2022-11-21 17:23:32 +01:00
parent 7de0b1c00e
commit 6e3ab111f3
4 changed files with 8 additions and 0 deletions

View File

@ -399,6 +399,7 @@ class DatabaseService {
Object? body = notSpecified,
Object? mediaUrl = notSpecified,
Object? mediaType = notSpecified,
bool? isMedia,
bool? received,
bool? displayed,
bool? acked,
@ -432,6 +433,9 @@ class DatabaseService {
if (mediaType != notSpecified) {
m['mediaType'] = mediaType as String?;
}
if (isMedia != null) {
m['isMedia'] = boolToInt(isMedia);
}
if (received != null) {
m['received'] = boolToInt(received);
}

View File

@ -604,6 +604,7 @@ Future<void> performMessageRetraction(RetractMessageComment command, { dynamic e
// Update the database
final retractedMessage = await GetIt.I.get<MessageService>().updateMessage(
msg.id,
isMedia: false,
mediaUrl: null,
mediaType: null,
warningType: null,

View File

@ -124,6 +124,7 @@ class MessageService {
Object? body = notSpecified,
Object? mediaUrl = notSpecified,
Object? mediaType = notSpecified,
bool? isMedia,
bool? received,
bool? displayed,
bool? acked,
@ -166,6 +167,7 @@ class MessageService {
originId: originId,
sid: sid,
isRetracted: isRetracted,
isMedia: isMedia,
);
if (_messageCache.containsKey(newMessage.conversationJid)) {

View File

@ -772,6 +772,7 @@ class XmppService {
final retractedMessage = await GetIt.I.get<MessageService>().updateMessage(
msg.id,
isMedia: false,
mediaUrl: null,
mediaType: null,
warningType: null,