Fix outgoing message status for messages sent from linked devices.
// FREEBIE
This commit is contained in:
parent
bb24ffc917
commit
a3db112c50
@ -86,8 +86,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
attachmentIds:[NSMutableArray new]
|
||||
expiresInSeconds:transcript.expirationDuration
|
||||
expireStartedAt:transcript.expirationStartedAt];
|
||||
// Since updateWithWasDelivered is a new message, updateWithWasDelivered will save it.
|
||||
[textMessage updateWithWasDelivered];
|
||||
// Since textMessage is a new message, updateWithWasSentAndDelivered will save it.
|
||||
[textMessage updateWithWasSentAndDelivered];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,6 +159,7 @@ typedef NS_ENUM(NSInteger, TSGroupMetaMessage) {
|
||||
- (void)updateWithCustomMessage:(NSString *)customMessage;
|
||||
- (void)updateWithWasDeliveredWithTransaction:(YapDatabaseReadWriteTransaction *)transaction;
|
||||
- (void)updateWithWasDelivered;
|
||||
- (void)updateWithWasSentAndDelivered;
|
||||
|
||||
#pragma mark - Sent Recipients
|
||||
|
||||
|
||||
@ -291,6 +291,17 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)updateWithWasSentAndDelivered
|
||||
{
|
||||
[self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||
[self applyChangeToSelfAndLatestOutgoingMessage:transaction
|
||||
changeBlock:^(TSOutgoingMessage *message) {
|
||||
[message setMessageState:TSOutgoingMessageStateSentToService];
|
||||
[message setWasDelivered:YES];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Sent Recipients
|
||||
|
||||
- (NSArray<NSString *> *)sentRecipients
|
||||
|
||||
@ -1005,7 +1005,7 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException";
|
||||
|
||||
- (void)handleMessageSentRemotely:(TSOutgoingMessage *)message sentAt:(uint64_t)sentAt
|
||||
{
|
||||
[message updateWithWasDelivered];
|
||||
[message updateWithWasSentAndDelivered];
|
||||
[self becomeConsistentWithDisappearingConfigurationForMessage:message];
|
||||
[self.disappearingMessagesJob setExpirationForMessage:message expirationStartedAt:sentAt];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user