mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'charlesmchen/sendGifTwice'
This commit is contained in:
commit
31941de1bf
3 changed files with 20 additions and 4 deletions
|
@ -2330,9 +2330,6 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
|
|||
OWSAssert([NSThread isMainThread]);
|
||||
OWSAssert(message);
|
||||
|
||||
[self.editingDatabaseConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
||||
[message saveWithTransaction:transaction];
|
||||
}];
|
||||
[self updateLastVisibleTimestamp:message.timestampForSorting];
|
||||
self.lastMessageSentDate = [NSDate new];
|
||||
[self clearUnreadMessagesIndicator];
|
||||
|
|
|
@ -326,7 +326,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
} else {
|
||||
NSString *_Nullable attachmentId = interaction.attachmentIds.firstObject;
|
||||
if (attachmentId.length > 0) {
|
||||
TSAttachment *attachment = [TSAttachment fetchObjectWithUniqueID:attachmentId];
|
||||
TSAttachment *_Nullable attachment = [TSAttachment fetchObjectWithUniqueID:attachmentId];
|
||||
if ([attachment isKindOfClass:[TSAttachmentStream class]]) {
|
||||
self.attachmentStream = (TSAttachmentStream *)attachment;
|
||||
|
||||
|
@ -364,10 +364,15 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
self.messageCellType = OWSMessageCellType_DownloadingAttachment;
|
||||
self.attachmentPointer = (TSAttachmentPointer *)attachment;
|
||||
return;
|
||||
} else {
|
||||
OWSFail(@"%@ Unknown attachment type", self.tag);
|
||||
}
|
||||
} else {
|
||||
OWSFail(@"%@ Message has neither attachment nor body", self.tag);
|
||||
}
|
||||
}
|
||||
|
||||
DDLogVerbose(@"%@ interaction: %@", self.tag, interaction.description);
|
||||
OWSFail(@"%@ Unknown cell type", self.tag);
|
||||
|
||||
self.messageCellType = OWSMessageCellType_Unknown;
|
||||
|
|
|
@ -300,6 +300,20 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return instance;
|
||||
}
|
||||
|
||||
- (void)setFilePath:(NSString *)filePath
|
||||
{
|
||||
OWSAssert(filePath.length > 0);
|
||||
|
||||
#ifdef DEBUG
|
||||
BOOL isDirectory;
|
||||
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:filePath isDirectory:&isDirectory];
|
||||
OWSAssert(exists);
|
||||
OWSAssert(!isDirectory);
|
||||
#endif
|
||||
|
||||
_filePath = filePath;
|
||||
}
|
||||
|
||||
- (NSData *)data
|
||||
{
|
||||
OWSAssert(self.filePath);
|
||||
|
|
Loading…
Reference in a new issue