Log when we mark a message as read locally

This is in pursuit of some now (for me) un-reproducible behavior where
messages on some clients were being immediately marked as read.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 311d80fb2e
commit bc1af80733

@ -1,5 +1,6 @@
// Created by Frederic Jacobs on 15/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "TSIncomingMessage.h"
#import "TSContactThread.h"
@ -127,9 +128,22 @@ NSString *const TSIncomingMessageWasReadOnThisDeviceNotification = @"TSIncomingM
- (void)markAsReadWithoutNotificationWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
DDLogInfo(@"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.tag, self.uniqueId, self.timestamp);
_read = YES;
[self saveWithTransaction:transaction];
[transaction touchObjectForKey:self.uniqueThreadId inCollection:[TSThread collection]];
[self touchThreadWithTransaction:transaction];
}
#pragma mark - Logging
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end

@ -75,6 +75,8 @@ NSUInteger TSCallCurrentSchemaVersion = 1;
- (void)markAsReadLocallyWithTransaction:(YapDatabaseReadWriteTransaction *)transaction
{
DDLogInfo(@"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.tag, self.uniqueId, self.timestamp);
_read = YES;
[self saveWithTransaction:transaction];
@ -89,6 +91,18 @@ NSUInteger TSCallCurrentSchemaVersion = 1;
}];
}
#pragma mark - Logging
+ (NSString *)tag
{
return [NSString stringWithFormat:@"[%@]", self.class];
}
- (NSString *)tag
{
return self.class.tag;
}
@end
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save