diff --git a/Postbox.xcodeproj/project.pbxproj b/Postbox.xcodeproj/project.pbxproj index 6229411d59..8fdd01099e 100644 --- a/Postbox.xcodeproj/project.pbxproj +++ b/Postbox.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 9F5B6E762011449F00C58B2A /* PostboxLogging.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0ECCB8E1FE9EB5500609802 /* PostboxLogging.swift */; }; + 9F5B6E772011449F00C58B2A /* GroupChatListInclusion.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0943AF01FD99DCD001522CC /* GroupChatListInclusion.swift */; }; C20EB2A31F7179DC00DD3A57 /* PeerNotificationSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0AE3EBB1F68261B0069BC90 /* PeerNotificationSettingsView.swift */; }; C25B56FE1F431C3300581D02 /* MessageHistoryTagsSummaryTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D070479F1F3CE16500F6A8D4 /* MessageHistoryTagsSummaryTable.swift */; }; C2A315BC1E2E730400D89000 /* PeerOperationLogTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0AD23261E194D1C00A7089A /* PeerOperationLogTable.swift */; }; @@ -1087,6 +1089,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9F5B6E762011449F00C58B2A /* PostboxLogging.swift in Sources */, + 9F5B6E772011449F00C58B2A /* GroupChatListInclusion.swift in Sources */, C20EB2A31F7179DC00DD3A57 /* PeerNotificationSettingsView.swift in Sources */, C25B56FE1F431C3300581D02 /* MessageHistoryTagsSummaryTable.swift in Sources */, D050F2661E4A5B5A00988324 /* MessageGloballyUniqueIdTable.swift in Sources */, @@ -1694,7 +1698,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; @@ -1959,7 +1963,7 @@ CLANG_WARN_SUSPICIOUS_MOVES = YES; CODE_SIGN_IDENTITY = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; diff --git a/Postbox/MediaBox.swift b/Postbox/MediaBox.swift index 8d0d25910e..5c5c7316dc 100644 --- a/Postbox/MediaBox.swift +++ b/Postbox/MediaBox.swift @@ -1120,4 +1120,14 @@ public final class MediaBox { return EmptyDisposable } } + + public func clearFileContexts() -> Signal { + return Signal { subscriber in + self.dataQueue.async { + self.fileContexts.removeAll() + subscriber.putCompletion() + } + return EmptyDisposable + } + } } diff --git a/Postbox/Message.swift b/Postbox/Message.swift index 367d60b731..bea18659fa 100644 --- a/Postbox/Message.swift +++ b/Postbox/Message.swift @@ -459,6 +459,10 @@ public extension MessageAttribute { public struct MessageGroupInfo: Equatable { public let stableId: UInt32 + public init(stableId: UInt32) { + self.stableId = stableId + } + public static func ==(lhs: MessageGroupInfo, rhs: MessageGroupInfo) -> Bool { return lhs.stableId == rhs.stableId } @@ -506,6 +510,11 @@ public final class Message { self.peers = peers self.associatedMessages = associatedMessages self.associatedMessageIds = associatedMessageIds + + if media.isEmpty && text.isEmpty { + var bp:Int = 0 + bp += 1 + } } public func withUpdatedFlags(_ flags: MessageFlags) -> Message { diff --git a/Postbox/MessageHistoryTable.swift b/Postbox/MessageHistoryTable.swift index e9766a1629..85f6f836cc 100644 --- a/Postbox/MessageHistoryTable.swift +++ b/Postbox/MessageHistoryTable.swift @@ -1133,7 +1133,9 @@ final class MessageHistoryTable: Table { let (_, lowerGroup) = lowerEntryAndGroup let (_, upperGroup) = upperEntryAndGroup - switch (lowerGroup, upperGroup) { + NSLog("\(lowerEntryAndGroup.1), \(upperEntryAndGroup.1)") + + switch (lowerEntryAndGroup.1, upperEntryAndGroup.1) { case (.none, .none): groupInfo = self.generateNewGroupInfo() case (.none, .otherGroup): @@ -1958,8 +1960,8 @@ final class MessageHistoryTable: Table { let updatedIndex = MessageIndex(id: index.id, timestamp: timestamp) self.valueBox.remove(self.table, key: self.key(index)) - - let updatedGroupInfo = self.updateMovingGroupInfo(index: index, updatedIndex: updatedIndex, groupingKey: previousMessage.groupingKey, previousInfo: previousMessage.groupInfo, updatedGroupInfos: &updatedGroupInfos) + //TODO changed updatedIndex -> index + let updatedGroupInfo = self.updateMovingGroupInfo(index: index, updatedIndex: index, groupingKey: previousMessage.groupingKey, previousInfo: previousMessage.groupInfo, updatedGroupInfos: &updatedGroupInfos) if let updatedGroupInfo = updatedGroupInfo, previousMessage.groupInfo != updatedGroupInfo { updatedGroupInfos[index.id] = updatedGroupInfo }