mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Automatically mark as read any messages sent by current user from another device.
// FREEBIE
This commit is contained in:
parent
4e8ab21c41
commit
6d356e4b67
|
@ -633,6 +633,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
if (thread && incomingMessage) {
|
||||
[incomingMessage saveWithTransaction:transaction];
|
||||
|
||||
// Any messages sent from the current user - from this device or another - should be
|
||||
// automatically marked as read.
|
||||
if ([TSAccountManager isRegistered]) {
|
||||
BOOL shouldMarkMessageAsRead = [envelope.source isEqualToString:[TSAccountManager localNumber]];
|
||||
if (shouldMarkMessageAsRead) {
|
||||
[incomingMessage markAsReadLocallyWithTransaction:transaction];
|
||||
}
|
||||
}
|
||||
|
||||
// Android allows attachments to be sent with body.
|
||||
if ([attachmentIds count] > 0 && body != nil && ![body isEqualToString:@""]) {
|
||||
// We want the text to be displayed under the attachment
|
||||
|
|
Loading…
Reference in a new issue