Elaborate Debug & Internal UI.

pull/1/head
Matthew Chen 7 years ago
parent 32b3e89c54
commit 9d101c3f53

@ -991,6 +991,7 @@ NS_ASSUME_NONNULL_BEGIN
[self sendFakeMessages:counter thread:thread transaction:transaction]; [self sendFakeMessages:counter thread:thread transaction:transaction];
}]; }];
remainder -= batchSize; remainder -= batchSize;
DDLogInfo(@"%@ sendFakeMessages %zd / %zd", self.logTag, counter - remainder, counter);
} }
} }
@ -1010,7 +1011,8 @@ NS_ASSUME_NONNULL_BEGIN
authorId:@"+19174054215" authorId:@"+19174054215"
sourceDeviceId:0 sourceDeviceId:0
messageBody:randomText]; messageBody:randomText];
DDLogError(@"%@ sendFakeMessages incoming timestamp: %llu.", self.logTag, message.timestamp); // DDLogError(@"%@ sendFakeMessages incoming timestamp: %llu.", self.logTag,
// message.timestamp);
[message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO]; [message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO];
break; break;
} }
@ -1019,8 +1021,10 @@ NS_ASSUME_NONNULL_BEGIN
[[TSOutgoingMessage alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] [[TSOutgoingMessage alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp]
inThread:thread inThread:thread
messageBody:randomText]; messageBody:randomText];
DDLogError(@"%@ sendFakeMessages outgoing timestamp: %llu.", self.logTag, message.timestamp); // DDLogError(@"%@ sendFakeMessages outgoing timestamp: %llu.", self.logTag,
// message.timestamp);
[message saveWithTransaction:transaction]; [message saveWithTransaction:transaction];
[message updateWithMessageState:TSOutgoingMessageStateUnsent transaction:transaction];
break; break;
} }
case 2: { case 2: {
@ -1045,7 +1049,8 @@ NS_ASSUME_NONNULL_BEGIN
pointer.uniqueId, pointer.uniqueId,
] ]
expiresInSeconds:0]; expiresInSeconds:0];
DDLogError(@"%@ sendFakeMessages incoming attachment timestamp: %llu.", self.logTag, message.timestamp); // DDLogError(@"%@ sendFakeMessages incoming attachment timestamp: %llu.", self.logTag,
// message.timestamp);
[message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO]; [message markAsReadWithTransaction:transaction sendReadReceipt:NO updateExpiration:NO];
break; break;
} }
@ -1056,7 +1061,8 @@ NS_ASSUME_NONNULL_BEGIN
messageBody:nil messageBody:nil
isVoiceMessage:NO isVoiceMessage:NO
expiresInSeconds:0]; expiresInSeconds:0];
DDLogError(@"%@ sendFakeMessages outgoing attachment timestamp: %llu.", self.logTag, message.timestamp); // DDLogError(@"%@ sendFakeMessages outgoing attachment timestamp: %llu.", self.logTag,
// message.timestamp);
NSString *filename = @"test.mp3"; NSString *filename = @"test.mp3";
UInt32 filesize = 16; UInt32 filesize = 16;
@ -1075,6 +1081,7 @@ NS_ASSUME_NONNULL_BEGIN
message.attachmentFilenameMap[attachmentStream.uniqueId] = filename; message.attachmentFilenameMap[attachmentStream.uniqueId] = filename;
} }
[message saveWithTransaction:transaction]; [message saveWithTransaction:transaction];
[message updateWithMessageState:TSOutgoingMessageStateUnsent transaction:transaction];
break; break;
} }
} }

@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSFail(@"%@ Missing path for attachment.", self.logTag); OWSFail(@"%@ Missing path for attachment.", self.logTag);
return NO; return NO;
} }
DDLogInfo(@"%@ Writing attachment to file: %@", self.logTag, filePath); DDLogInfo(@"%@ Writing attachment data to file: %@", self.logTag, filePath);
return [data writeToFile:filePath options:0 error:error]; return [data writeToFile:filePath options:0 error:error];
} }
@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSFail(@"%@ Missing path for attachment.", self.logTag); OWSFail(@"%@ Missing path for attachment.", self.logTag);
return NO; return NO;
} }
DDLogInfo(@"%@ Writing attachment to file: %@", self.logTag, filePath); DDLogInfo(@"%@ Writing attachment data source to file: %@", self.logTag, filePath);
return [dataSource writeToPath:filePath]; return [dataSource writeToPath:filePath];
} }

@ -1,5 +1,5 @@
// //
// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // Copyright (c) 2018 Open Whisper Systems. All rights reserved.
// //
#import "TSIncomingMessage.h" #import "TSIncomingMessage.h"
@ -156,8 +156,8 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
DDLogDebug( // DDLogDebug(
@"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.logTag, self.uniqueId, self.timestamp); // @"%@ marking as read uniqueId: %@ which has timestamp: %llu", self.logTag, self.uniqueId, self.timestamp);
_read = YES; _read = YES;
[self saveWithTransaction:transaction]; [self saveWithTransaction:transaction];
[self touchThreadWithTransaction:transaction]; [self touchThreadWithTransaction:transaction];

Loading…
Cancel
Save