Merge commit 'ebe5d4eebaa7208c3f66d93a56f6a3c3ea66d885'

This commit is contained in:
Peter Iakovlev 2018-02-26 12:42:29 +04:00
commit 89a2a1c47f
4 changed files with 30 additions and 5 deletions

View File

@ -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;

View File

@ -1120,4 +1120,14 @@ public final class MediaBox {
return EmptyDisposable
}
}
public func clearFileContexts() -> Signal<Void, Void> {
return Signal { subscriber in
self.dataQueue.async {
self.fileContexts.removeAll()
subscriber.putCompletion()
}
return EmptyDisposable
}
}
}

View File

@ -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 {

View File

@ -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
}