mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-07-17 21:17:18 +02:00
chore: migrate to new version + fixed several critical bugs
- Migrated project to latest Telegram iOS base (v12.3.2+) - Fixed circular dependency between GhostModeManager and MiscSettingsManager - Fixed multiple Bazel build configuration errors (select() default conditions) - Fixed duplicate type definitions in PeerInfoScreen - Fixed swiftmodule directory resolution in build scripts - Added Ghostgram Settings tab in main Settings menu with all 5 features - Cleared sensitive credentials from config.json (template-only now) - Excluded bazel-cache from version control
This commit is contained in:
+37
-45
@@ -56,53 +56,53 @@ public enum ChatHistoryEntry: Identifiable, Comparable {
|
||||
case UnreadEntry(MessageIndex, ChatPresentationData)
|
||||
case ReplyCountEntry(MessageIndex, Bool, Int, ChatPresentationData)
|
||||
case ChatInfoEntry(ChatInfoData, ChatPresentationData)
|
||||
case SearchEntry(PresentationTheme, PresentationStrings)
|
||||
|
||||
public var stableId: UInt64 {
|
||||
switch self {
|
||||
case let .MessageEntry(message, _, _, _, _, attributes):
|
||||
let type: UInt64
|
||||
switch attributes.contentTypeHint {
|
||||
case .generic:
|
||||
type = 2
|
||||
case .largeEmoji:
|
||||
type = 3
|
||||
case .animatedEmoji:
|
||||
type = 4
|
||||
}
|
||||
return UInt64(message.stableId) | ((type << 40))
|
||||
case let .MessageGroupEntry(groupInfo, _, _):
|
||||
return UInt64(bitPattern: groupInfo) | ((UInt64(2) << 40))
|
||||
case .UnreadEntry:
|
||||
return UInt64(4) << 40
|
||||
case .ReplyCountEntry:
|
||||
return UInt64(5) << 40
|
||||
case .ChatInfoEntry:
|
||||
return UInt64(6) << 40
|
||||
case .SearchEntry:
|
||||
case let .MessageEntry(message, _, _, _, _, attributes):
|
||||
let type: UInt64
|
||||
switch attributes.contentTypeHint {
|
||||
case .generic:
|
||||
type = 2
|
||||
case .largeEmoji:
|
||||
type = 3
|
||||
case .animatedEmoji:
|
||||
type = 4
|
||||
}
|
||||
return UInt64(message.stableId) | ((type << 40))
|
||||
case let .MessageGroupEntry(groupInfo, _, _):
|
||||
return UInt64(bitPattern: groupInfo) | ((UInt64(2) << 40))
|
||||
case .UnreadEntry:
|
||||
return UInt64(4) << 40
|
||||
case .ReplyCountEntry:
|
||||
return UInt64(5) << 40
|
||||
case let .ChatInfoEntry(infoData, _):
|
||||
switch infoData {
|
||||
case .newThreadInfo:
|
||||
return UInt64(7) << 40
|
||||
default:
|
||||
return UInt64(6) << 40
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var index: MessageIndex {
|
||||
switch self {
|
||||
case let .MessageEntry(message, _, _, _, _, _):
|
||||
return message.index
|
||||
case let .MessageGroupEntry(_, messages, _):
|
||||
return messages[messages.count - 1].0.index
|
||||
case let .UnreadEntry(index, _):
|
||||
return index
|
||||
case let .ReplyCountEntry(index, _, _, _):
|
||||
return index
|
||||
case let .ChatInfoEntry(infoData, _):
|
||||
switch infoData {
|
||||
case .newThreadInfo:
|
||||
return MessageIndex.absoluteUpperBound()
|
||||
default:
|
||||
return MessageIndex.absoluteLowerBound()
|
||||
}
|
||||
case .SearchEntry:
|
||||
case let .MessageEntry(message, _, _, _, _, _):
|
||||
return message.index
|
||||
case let .MessageGroupEntry(_, messages, _):
|
||||
return messages[messages.count - 1].0.index
|
||||
case let .UnreadEntry(index, _):
|
||||
return index
|
||||
case let .ReplyCountEntry(index, _, _, _):
|
||||
return index
|
||||
case let .ChatInfoEntry(infoData, _):
|
||||
switch infoData {
|
||||
case .newThreadInfo:
|
||||
return MessageIndex.absoluteUpperBound()
|
||||
default:
|
||||
return MessageIndex.absoluteLowerBound()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,8 +123,6 @@ public enum ChatHistoryEntry: Identifiable, Comparable {
|
||||
default:
|
||||
return MessageIndex.absoluteLowerBound()
|
||||
}
|
||||
case .SearchEntry:
|
||||
return MessageIndex.absoluteLowerBound()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,12 +295,6 @@ public enum ChatHistoryEntry: Identifiable, Comparable {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case let .SearchEntry(lhsTheme, lhsStrings):
|
||||
if case let .SearchEntry(rhsTheme, rhsStrings) = rhs, lhsTheme === rhsTheme, lhsStrings === rhsStrings {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user