Removing dead code part 3 (#2264)

This commit is contained in:
Mauro
2023-12-19 12:12:16 +01:00
committed by GitHub
parent 334d55aeaf
commit 09fb5461e6
77 changed files with 48 additions and 462 deletions
@@ -31,18 +31,6 @@ extension String {
return string
}
/// Calculates a numeric hash same as Element Web
/// See original function here https://github.com/matrix-org/matrix-react-sdk/blob/321dd49db4fbe360fc2ff109ac117305c955b061/src/utils/FormattingUtils.js#L47
var hashCode: Int32 {
var hash: Int32 = 0
for character in self {
let shiftedHash = hash << 5
hash = shiftedHash.subtractingReportingOverflow(hash).partialValue + Int32(character.unicodeScalars[character.unicodeScalars.startIndex].value)
}
return abs(hash)
}
var isASCII: Bool {
allSatisfy(\.isASCII)
@@ -44,10 +44,6 @@ extension UNNotificationContent {
@objc var roomID: String? {
userInfo[NotificationConstants.UserInfoKey.roomIdentifier] as? String
}
@objc var eventID: String? {
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] as? String
}
}
extension UNMutableNotificationContent {
@@ -69,15 +65,6 @@ extension UNMutableNotificationContent {
}
}
override var eventID: String? {
get {
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] as? String
}
set {
userInfo[NotificationConstants.UserInfoKey.eventIdentifier] = newValue
}
}
func addMediaAttachment(using mediaProvider: MediaProviderProtocol?,
mediaSource: MediaSourceProxy) async -> UNMutableNotificationContent {
guard let mediaProvider else {
@@ -47,17 +47,6 @@ extension URL: ExpressibleByStringLiteral {
return applicationSupportSessionsURL
}
/// The base directory where all cache is stored.
static var cacheBaseDirectory: URL {
let url = appGroupContainerDirectory
.appendingPathComponent("Library", isDirectory: true)
.appendingPathComponent("Caches", isDirectory: true)
try? FileManager.default.createDirectoryIfNeeded(at: url)
return url
}
/// The base directory where all application support data is stored.
static var applicationSupportBaseDirectory: URL {