From e789cc43feb0d18f4f7d5d8a2f36adaa78f5aefc Mon Sep 17 00:00:00 2001 From: Max Radermacher Date: Thu, 4 May 2023 15:58:11 -0700 Subject: [PATCH] Remove unused ChatColors code --- .../src/ViewControllers/DebugUI/DebugUIMisc.m | 9 ---- SignalUI/Appearance/ChatColors.swift | 42 ------------------- 2 files changed, 51 deletions(-) diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m b/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m index d2b38781b6..1ba86376c5 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m @@ -171,9 +171,6 @@ NS_ASSUME_NONNULL_BEGIN [items addObject:[OWSTableItem itemWithTitle:@"Log all sticker suggestions" actionBlock:^() { [DebugUIMisc logStickerSuggestions]; }]]; - [items addObject:[OWSTableItem itemWithTitle:@"Create chat colors" - actionBlock:^() { [DebugUIMisc createChatColors]; }]]; - [items addObject:[OWSTableItem itemWithTitle:@"Log Local Account" actionBlock:^() { [DebugUIMisc logLocalAccount]; }]]; @@ -413,12 +410,6 @@ NS_ASSUME_NONNULL_BEGIN [[emojiSet.allObjects sortedArrayUsingSelector:@selector(compare:)] componentsJoinedByString:@" "]); } -+ (void)createChatColors -{ - DatabaseStorageWrite(SDSDatabaseStorage.shared, - ^(SDSAnyWriteTransaction *transaction) { [ChatColors createFakeChatColorsWithTransaction:transaction]; }); -} - @end NS_ASSUME_NONNULL_END diff --git a/SignalUI/Appearance/ChatColors.swift b/SignalUI/Appearance/ChatColors.swift index deb952d7c8..c4fd94e999 100644 --- a/SignalUI/Appearance/ChatColors.swift +++ b/SignalUI/Appearance/ChatColors.swift @@ -150,40 +150,6 @@ public class ChatColors: NSObject, Dependencies { } } - #if DEBUG - @objc - public static func createFakeChatColors(transaction: SDSAnyWriteTransaction) { - - func randomOWSColorComponent() -> CGFloat { - CGFloat.random(in: 0..<1, choices: 256) - } - - func randomOWSColor() -> OWSColor { - OWSColor(red: randomOWSColorComponent(), - green: randomOWSColorComponent(), - blue: randomOWSColorComponent()) - } - - func randomAngleRadians() -> CGFloat { - CGFloat.random(in: 0..<(CGFloat.pi * 2), choices: 256) - } - - let count = 256 - for _ in 0.. ChatColor { - guard let thread = TSContactThread.getWithContactAddress(address, transaction: transaction) else { - return Self.defaultChatColor - } - return chatColorForRendering(thread: thread, transaction: transaction) - } - public static func setChatColorSetting(_ value: ChatColor?, thread: TSThread, transaction: SDSAnyWriteTransaction) {