From 8e5e113ecfcd9e2a577dce2a44e7b89c40d83bc9 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 15 Oct 2019 10:50:06 +1100 Subject: [PATCH] Clean --- Signal.xcodeproj/project.pbxproj | 16 +++------- Signal/src/AppDelegate.h | 3 +- Signal/src/AppDelegate.m | 12 ++------ ...edPoller.swift => LokiRSSFeedPoller.swift} | 2 +- .../Loki/MentionCandidateSelectionView.swift | 16 +++++----- .../src/Loki/Onboarding/DisplayNameVC.swift | 5 ++++ .../ConversationInputToolbar.m | 2 +- .../HomeView/HomeViewController.m | 4 +-- .../environment/VersionMigrations.m | 4 +-- ...{LongPoller.swift => LokiLongPoller.swift} | 2 +- .../API/{Public Chat => }/LokiRSSFeed.swift | 0 .../Loki/API/Public Chat/LokiPublicChat.swift | 10 ------- .../API/Public Chat/LokiPublicChatAPI.swift | 15 ++++++++-- .../Public Chat/LokiPublicChatManager.swift | 6 ++-- ...oller.swift => LokiPublicChatPoller.swift} | 30 +++++++++---------- 15 files changed, 58 insertions(+), 69 deletions(-) rename Signal/src/Loki/{Group Chat/RSSFeedPoller.swift => LokiRSSFeedPoller.swift} (98%) rename SignalServiceKit/src/Loki/API/{LongPoller.swift => LokiLongPoller.swift} (98%) rename SignalServiceKit/src/Loki/API/{Public Chat => }/LokiRSSFeed.swift (100%) rename SignalServiceKit/src/Loki/API/Public Chat/{PublicChatPoller.swift => LokiPublicChatPoller.swift} (88%) diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 2c08f62f4..e7ef3e96a 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -565,7 +565,7 @@ B821F2F82272CED3002C88C0 /* DisplayNameVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B821F2F72272CED3002C88C0 /* DisplayNameVC.swift */; }; B821F2FA2272CEEE002C88C0 /* SeedVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B821F2F92272CEEE002C88C0 /* SeedVC.swift */; }; B8258493230FA5E9001B41CB /* ScanQRCodeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = B8258492230FA5E9001B41CB /* ScanQRCodeVC.m */; }; - B82584A02315024B001B41CB /* RSSFeedPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = B825849F2315024B001B41CB /* RSSFeedPoller.swift */; }; + B82584A02315024B001B41CB /* LokiRSSFeedPoller.swift in Sources */ = {isa = PBXBuildFile; fileRef = B825849F2315024B001B41CB /* LokiRSSFeedPoller.swift */; }; B846365B22B7418B00AF1514 /* Identicon+ObjC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B846365A22B7418B00AF1514 /* Identicon+ObjC.swift */; }; B84664F5235022F30083A1CD /* MentionUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = B84664F4235022F30083A1CD /* MentionUtilities.swift */; }; B86BD08123399883000F5AE3 /* QRCodeModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = B86BD08023399883000F5AE3 /* QRCodeModal.swift */; }; @@ -1377,7 +1377,7 @@ B821F2F92272CEEE002C88C0 /* SeedVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeedVC.swift; sourceTree = ""; }; B8258491230FA5DA001B41CB /* ScanQRCodeVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanQRCodeVC.h; sourceTree = ""; }; B8258492230FA5E9001B41CB /* ScanQRCodeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanQRCodeVC.m; sourceTree = ""; }; - B825849F2315024B001B41CB /* RSSFeedPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RSSFeedPoller.swift; sourceTree = ""; }; + B825849F2315024B001B41CB /* LokiRSSFeedPoller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LokiRSSFeedPoller.swift; sourceTree = ""; }; B846365A22B7418B00AF1514 /* Identicon+ObjC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Identicon+ObjC.swift"; sourceTree = ""; }; B84664F4235022F30083A1CD /* MentionUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentionUtilities.swift; sourceTree = ""; }; B86BD08023399883000F5AE3 /* QRCodeModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QRCodeModal.swift; sourceTree = ""; }; @@ -2647,7 +2647,6 @@ B8439518228510E9000563FE /* Loki */ = { isa = PBXGroup; children = ( - B86BD0892339A278000F5AE3 /* Group Chat */, B86BD0872339A1ED000F5AE3 /* Onboarding */, B86BD08223399ABF000F5AE3 /* Settings */, B86BD0882339A253000F5AE3 /* Utilities */, @@ -2655,6 +2654,7 @@ B8162F0422892C5F00D46544 /* FriendRequestViewDelegate.swift */, 24A830A12293CD0100F4CAC0 /* LokiP2PServer.swift */, B89841E222B7579F00B1BDC6 /* NewConversationVC.swift */, + B825849F2315024B001B41CB /* LokiRSSFeedPoller.swift */, B8258491230FA5DA001B41CB /* ScanQRCodeVC.h */, B8258492230FA5E9001B41CB /* ScanQRCodeVC.m */, 24BD2608234DA2050008EB0A /* NewPublicChatVC.swift */, @@ -2706,14 +2706,6 @@ path = Utilities; sourceTree = ""; }; - B86BD0892339A278000F5AE3 /* Group Chat */ = { - isa = PBXGroup; - children = ( - B825849F2315024B001B41CB /* RSSFeedPoller.swift */, - ); - path = "Group Chat"; - sourceTree = ""; - }; D221A07E169C9E5E00537ABF = { isa = PBXGroup; children = ( @@ -3786,7 +3778,7 @@ 4C4AEC4520EC343B0020E72B /* DismissableTextField.swift in Sources */, 4CB5F26720F6E1E2004D1B42 /* MenuActionsViewController.swift in Sources */, 3496955E219B605E00DCFE74 /* PhotoLibrary.swift in Sources */, - B82584A02315024B001B41CB /* RSSFeedPoller.swift in Sources */, + B82584A02315024B001B41CB /* LokiRSSFeedPoller.swift in Sources */, 24A830A22293CD0100F4CAC0 /* LokiP2PServer.swift in Sources */, 349ED990221B0194008045B0 /* Onboarding2FAViewController.swift in Sources */, 45D231771DC7E8F10034FA89 /* SessionResetJob.swift in Sources */, diff --git a/Signal/src/AppDelegate.h b/Signal/src/AppDelegate.h index 273023d2a..3cf39a281 100644 --- a/Signal/src/AppDelegate.h +++ b/Signal/src/AppDelegate.h @@ -10,9 +10,8 @@ extern NSString *const AppDelegateStoryboardMain; - (void)startLongPollerIfNeeded; - (void)stopLongPollerIfNeeded; -- (void)createGroupChatsIfNeeded; +- (void)setUpDefaultPublicChatsIfNeeded; - (void)createRSSFeedsIfNeeded; -- (void)startGroupChatPollersIfNeeded; - (void)startRSSFeedPollersIfNeeded; @end diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 3afa2da86..abe7bbd77 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1534,11 +1534,10 @@ static NSTimeInterval launchStartedAt; return [[LKRSSFeed alloc] initWithId:@"loki.network.messenger-updates.feed" server:@"https://loki.network/category/messenger-updates/feed/" displayName:NSLocalizedString(@"Loki Messenger Updates", @"") isDeletable:false]; } -- (void)createGroupChatsIfNeeded +- (void)setUpDefaultPublicChatsIfNeeded { - // Setup our default public chats - for (LKPublicChat *chat in LKPublicChat.defaultChats) { - NSString *userDefaultsKey = [@"isGroupChatSetUp." stringByAppendingString:chat.id]; + for (LKPublicChat *chat in LKPublicChatAPI.defaultChats) { + NSString *userDefaultsKey = [@"isGroupChatSetUp." stringByAppendingString:chat.id]; // Should ideally be isPublicChatSetUp BOOL isChatSetUp = [NSUserDefaults.standardUserDefaults boolForKey:userDefaultsKey]; if (!isChatSetUp || !chat.isDeletable) { [LKPublicChatManager.shared addChatWithServer:chat.server channel:chat.channel name:chat.displayName]; @@ -1593,11 +1592,6 @@ static NSTimeInterval launchStartedAt; } } -- (void)startGroupChatPollersIfNeeded -{ - [LKPublicChatManager.shared startPollersIfNeeded]; -} - - (void)startRSSFeedPollersIfNeeded { [self createRSSFeedPollersIfNeeded]; diff --git a/Signal/src/Loki/Group Chat/RSSFeedPoller.swift b/Signal/src/Loki/LokiRSSFeedPoller.swift similarity index 98% rename from Signal/src/Loki/Group Chat/RSSFeedPoller.swift rename to Signal/src/Loki/LokiRSSFeedPoller.swift index 5636e1386..2f2d3818e 100644 --- a/Signal/src/Loki/Group Chat/RSSFeedPoller.swift +++ b/Signal/src/Loki/LokiRSSFeedPoller.swift @@ -1,7 +1,7 @@ import FeedKit @objc(LKRSSFeedPoller) -public final class RSSFeedPoller : NSObject { +public final class LokiRSSFeedPoller : NSObject { private let feed: LokiRSSFeed private var timer: Timer? = nil private var hasStarted = false diff --git a/Signal/src/Loki/MentionCandidateSelectionView.swift b/Signal/src/Loki/MentionCandidateSelectionView.swift index 1f2f16c4d..26dc3b29e 100644 --- a/Signal/src/Loki/MentionCandidateSelectionView.swift +++ b/Signal/src/Loki/MentionCandidateSelectionView.swift @@ -5,13 +5,13 @@ final class MentionCandidateSelectionView : UIView, UITableViewDataSource, UITableViewDelegate { @objc var mentionCandidates: [Mention] = [] { didSet { tableView.reloadData() } } @objc var publicChatServer: String? - var publicChatServerID: UInt64? + var publicChatChannel: UInt64? @objc var delegate: MentionCandidateSelectionViewDelegate? // MARK: Convenience - @objc(setPublicChatServerID:) - func setPublicChatServerID(to publicChatServerID: UInt64) { - self.publicChatServerID = publicChatServerID != 0 ? publicChatServerID : nil + @objc(setPublicChatChannel:) + func setPublicChatChannel(to publicChatChannel: UInt64) { + self.publicChatChannel = publicChatChannel != 0 ? publicChatChannel : nil } // MARK: Components @@ -52,7 +52,7 @@ final class MentionCandidateSelectionView : UIView, UITableViewDataSource, UITab let mentionCandidate = mentionCandidates[indexPath.row] cell.mentionCandidate = mentionCandidate cell.publicChatServer = publicChatServer - cell.publicChatServerID = publicChatServerID + cell.publicChatChannel = publicChatChannel return cell } @@ -70,7 +70,7 @@ private extension MentionCandidateSelectionView { final class Cell : UITableViewCell { var mentionCandidate = Mention(hexEncodedPublicKey: "", displayName: "") { didSet { update() } } var publicChatServer: String? - var publicChatServerID: UInt64? + var publicChatChannel: UInt64? // MARK: Components private lazy var profilePictureImageView = AvatarImageView() @@ -130,8 +130,8 @@ private extension MentionCandidateSelectionView { displayNameLabel.text = mentionCandidate.displayName let profilePicture = OWSContactAvatarBuilder(signalId: mentionCandidate.hexEncodedPublicKey, colorName: .blue, diameter: 36).build() profilePictureImageView.image = profilePicture - if let publicChatServer = publicChatServer, let publicChatServerID = publicChatServerID { - let isUserModerator = LokiPublicChatAPI.isUserModerator(mentionCandidate.hexEncodedPublicKey, for: publicChatServerID, on: publicChatServer) + if let server = publicChatServer, let channel = publicChatChannel { + let isUserModerator = LokiPublicChatAPI.isUserModerator(mentionCandidate.hexEncodedPublicKey, for: channel, on: server) moderatorIconImageView.isHidden = !isUserModerator } else { moderatorIconImageView.isHidden = true diff --git a/Signal/src/Loki/Onboarding/DisplayNameVC.swift b/Signal/src/Loki/Onboarding/DisplayNameVC.swift index 58c5bf7e3..ae6640cc2 100644 --- a/Signal/src/Loki/Onboarding/DisplayNameVC.swift +++ b/Signal/src/Loki/Onboarding/DisplayNameVC.swift @@ -64,6 +64,11 @@ final class DisplayNameVC : OnboardingBaseViewController { TSAccountManager.sharedInstance().didRegister() UserDefaults.standard.set(true, forKey: "didUpdateForMainnet") onboardingController.verificationDidComplete(fromView: self) + let appDelegate = UIApplication.shared.delegate as! AppDelegate + appDelegate.setUpDefaultPublicChatsIfNeeded() + appDelegate.createRSSFeedsIfNeeded() + LokiPublicChatManager.shared.startPollersIfNeeded() + appDelegate.startRSSFeedPollersIfNeeded() OWSProfileManager.shared().updateLocalProfileName(displayName, avatarImage: nil, success: { }, failure: { }) // Try to save the user name but ignore the result } } diff --git a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m index c31d07915..29f9961a5 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.m @@ -1099,7 +1099,7 @@ const CGFloat kMaxTextViewHeight = 98; }]; if (publicChat != nil) { self.mentionCandidateSelectionView.publicChatServer = publicChat.server; - [self.mentionCandidateSelectionView setPublicChatServerID:publicChat.channel]; + [self.mentionCandidateSelectionView setPublicChatChannel:publicChat.channel]; } self.mentionCandidateSelectionView.mentionCandidates = mentionCandidates; self.mentionCandidateSelectionViewSizeConstraint.constant = 6 + MIN(mentionCandidates.count, 4) * 52; diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 23286342f..c7bd82edc 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -693,9 +693,9 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { } if (OWSIdentityManager.sharedManager.identityKeyPair != nil) { AppDelegate *appDelegate = (AppDelegate *)UIApplication.sharedApplication.delegate; - [appDelegate createGroupChatsIfNeeded]; + [appDelegate setUpDefaultPublicChatsIfNeeded]; [appDelegate createRSSFeedsIfNeeded]; - [appDelegate startGroupChatPollersIfNeeded]; + [LKPublicChatManager.shared startPollersIfNeeded]; [appDelegate startRSSFeedPollersIfNeeded]; } } diff --git a/SignalMessaging/environment/VersionMigrations.m b/SignalMessaging/environment/VersionMigrations.m index a195c1444..5d6288e6a 100644 --- a/SignalMessaging/environment/VersionMigrations.m +++ b/SignalMessaging/environment/VersionMigrations.m @@ -169,11 +169,11 @@ NS_ASSUME_NONNULL_BEGIN # pragma mark Loki - Upgrading to Public Chat Manager -// Versions less than or equal to 1.2.0 didn't store group chat mappings +// Versions less than or equal to 1.2.0 didn't store public chat mappings + (void)updatePublicChatMapping { [OWSPrimaryStorage.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction * _Nonnull transaction) { - for (LKPublicChat *chat in LKPublicChat.defaultChats) { + for (LKPublicChat *chat in LKPublicChatAPI.defaultChats) { TSGroupThread *thread = [TSGroupThread threadWithGroupId:chat.idAsData transaction:transaction]; if (thread != nil) { [LKDatabaseUtilities setPublicChat:chat threadID:thread.uniqueId transaction:transaction]; diff --git a/SignalServiceKit/src/Loki/API/LongPoller.swift b/SignalServiceKit/src/Loki/API/LokiLongPoller.swift similarity index 98% rename from SignalServiceKit/src/Loki/API/LongPoller.swift rename to SignalServiceKit/src/Loki/API/LokiLongPoller.swift index 805db762d..1acb6f7db 100644 --- a/SignalServiceKit/src/Loki/API/LongPoller.swift +++ b/SignalServiceKit/src/Loki/API/LokiLongPoller.swift @@ -1,7 +1,7 @@ import PromiseKit @objc(LKLongPoller) -public final class LongPoller : NSObject { +public final class LokiLongPoller : NSObject { private let onMessagesReceived: ([SSKProtoEnvelope]) -> Void private let storage = OWSPrimaryStorage.shared() private var hasStarted = false diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiRSSFeed.swift b/SignalServiceKit/src/Loki/API/LokiRSSFeed.swift similarity index 100% rename from SignalServiceKit/src/Loki/API/Public Chat/LokiRSSFeed.swift rename to SignalServiceKit/src/Loki/API/LokiRSSFeed.swift diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChat.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChat.swift index 7720dae79..b8958b67f 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChat.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChat.swift @@ -8,16 +8,6 @@ public final class LokiPublicChat : NSObject, NSCoding { @objc public let displayName: String @objc public let isDeletable: Bool - @objc public static var defaultChats: [LokiPublicChat] { - var chats = [LokiPublicChat(channel: UInt64(1), server: "https://chat.lokinet.org", displayName: NSLocalizedString("Loki Public Chat", comment: ""), isDeletable: true)!] - - #if DEBUG - chats.append(LokiPublicChat(channel: UInt64(1), server: "https://chat-dev.lokinet.org", displayName: "Loki Dev Chat", isDeletable: true)!) - #endif - - return chats - } - @objc public init?(channel: UInt64, server: String, displayName: String, isDeletable: Bool) { let id = "\(server).\(channel)" self.id = id diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift index f258cd8f7..7701c9722 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatAPI.swift @@ -12,6 +12,15 @@ public final class LokiPublicChatAPI : LokiDotNetAPI { @objc private static let channelInfoType = "net.patter-app.settings" @objc public static let publicChatMessageType = "network.loki.messenger.publicChat" + @objc public static let defaultChats: [LokiPublicChat] = { + var result: [LokiPublicChat] = [] + result.append(LokiPublicChat(channel: 1, server: "https://chat.lokinet.org", displayName: NSLocalizedString("Loki Public Chat", comment: ""), isDeletable: true)!) + #if DEBUG + result.append(LokiPublicChat(channel: 1, server: "https://chat-dev.lokinet.org", displayName: "Loki Dev Chat", isDeletable: true)!) + #endif + return result + }() + // MARK: Convenience private static var userDisplayName: String { return SSKEnvironment.shared.contactsManager.displayName(forPhoneIdentifier: userHexEncodedPublicKey) ?? "Anonymous" @@ -240,9 +249,9 @@ public final class LokiPublicChatAPI : LokiDotNetAPI { } } - public static func resetLastMessageCache(for group: UInt64, on server: String) { - removeLastMessageServerID(for: group, on: server) - removeLastDeletionServerID(for: group, on: server) + public static func clearCaches(for channel: UInt64, on server: String) { + removeLastMessageServerID(for: channel, on: server) + removeLastDeletionServerID(for: channel, on: server) } // MARK: Public API (Obj-C) diff --git a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift index 5825e7de9..fe67d10ed 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatManager.swift @@ -12,7 +12,7 @@ public final class LokiPublicChatManager: NSObject { @objc public static let shared = LokiPublicChatManager() private var chats: [String: LokiPublicChat] = [:] - private var pollers: [String: GroupChatPoller] = [:] + private var pollers: [String: LokiPublicChatPoller] = [:] private var isPolling = false private let storage = OWSPrimaryStorage.shared() @@ -33,7 +33,7 @@ public final class LokiPublicChatManager: NSObject { if let poller = pollers[threadID] { poller.startIfNeeded() } else { - let poller = GroupChatPoller(for: publicChat) + let poller = LokiPublicChatPoller(for: publicChat) poller.startIfNeeded() pollers[threadID] = poller } @@ -124,7 +124,7 @@ public final class LokiPublicChatManager: NSObject { // Reset the last message cache if let chat = self.chats[threadId] { - LokiPublicChatAPI.resetLastMessageCache(for: chat.channel, on: chat.server) + LokiPublicChatAPI.clearCaches(for: chat.channel, on: chat.server) } // Remove the chat from the db diff --git a/SignalServiceKit/src/Loki/API/Public Chat/PublicChatPoller.swift b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatPoller.swift similarity index 88% rename from SignalServiceKit/src/Loki/API/Public Chat/PublicChatPoller.swift rename to SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatPoller.swift index 5ac65b9f3..47159fbf8 100644 --- a/SignalServiceKit/src/Loki/API/Public Chat/PublicChatPoller.swift +++ b/SignalServiceKit/src/Loki/API/Public Chat/LokiPublicChatPoller.swift @@ -1,7 +1,7 @@ @objc(LKPublicChatPoller) -public final class GroupChatPoller : NSObject { - private let group: LokiPublicChat +public final class LokiPublicChatPoller : NSObject { + private let publicChat: LokiPublicChat private var pollForNewMessagesTimer: Timer? = nil private var pollForDeletedMessagesTimer: Timer? = nil private var pollForModeratorsTimer: Timer? = nil @@ -14,9 +14,9 @@ public final class GroupChatPoller : NSObject { private let pollForModeratorsInterval: TimeInterval = 10 * 60 // MARK: Lifecycle - @objc(initForGroup:) - public init(for group: LokiPublicChat) { - self.group = group + @objc(initForPublicChat:) + public init(for publicChat: LokiPublicChat) { + self.publicChat = publicChat super.init() } @@ -42,7 +42,7 @@ public final class GroupChatPoller : NSObject { // MARK: Polling private func pollForNewMessages() { // Prepare - let group = self.group + let publicChat = self.publicChat let userHexEncodedPublicKey = self.userHexEncodedPublicKey // Processing logic for incoming messages func processIncomingMessage(_ message: LokiPublicChatMessage) { @@ -50,9 +50,9 @@ public final class GroupChatPoller : NSObject { let endIndex = senderHexEncodedPublicKey.endIndex let cutoffIndex = senderHexEncodedPublicKey.index(endIndex, offsetBy: -8) let senderDisplayName = "\(message.displayName) (...\(senderHexEncodedPublicKey[cutoffIndex..