From 6056575cdfa684c4de13f6f33971f38a2b061674 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 27 Aug 2019 12:35:31 +1000 Subject: [PATCH] Clean --- Signal/src/AppDelegate.m | 8 ++++---- Signal/translations/en.lproj/Localizable.strings | 2 ++ SignalServiceKit/src/Loki/API/LokiGroupChat.swift | 15 +++++---------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m index 646c8edea..2abce65df 100644 --- a/Signal/src/AppDelegate.m +++ b/Signal/src/AppDelegate.m @@ -1495,10 +1495,10 @@ static NSTimeInterval launchStartedAt; - (NSArray *)publicChats { return @[ - [[LKGroupChat alloc] initWithKindAsString:@"publicChat" id:@(LKGroupChatAPI.publicChatID).stringValue server:LKGroupChatAPI.publicChatServer displayName:NSLocalizedString(@"Loki Public Chat", @"") isDeletable:true], - [[LKGroupChat alloc] initWithKindAsString:@"rss" id:@"loki.network.feed" server:@"https://loki.network/feed/" displayName:NSLocalizedString(@"Loki.network News", @"") isDeletable:true], - [[LKGroupChat alloc] initWithKindAsString:@"rss" id:@"loki.network.messenger-update" server:@"https://loki.network/category/messenger-updates/feed/" displayName:NSLocalizedString(@"Messenger updates", @"") isDeletable:false], - ]; + [[LKGroupChat alloc] initWithKindAsString:@"publicChat" id:@(LKGroupChatAPI.publicChatID).stringValue server:LKGroupChatAPI.publicChatServer displayName:NSLocalizedString(@"Loki Public Chat", @"") isDeletable:true], + [[LKGroupChat alloc] initWithKindAsString:@"rss" id:@"loki.network.feed" server:@"https://loki.network/feed/" displayName:NSLocalizedString(@"Loki News", @"") isDeletable:true], + [[LKGroupChat alloc] initWithKindAsString:@"rss" id:@"loki.network.messenger-update" server:@"https://loki.network/category/messenger-updates/feed/" displayName:NSLocalizedString(@"Messenger Updates", @"") isDeletable:false], + ]; } - (void)setupPublicChatGroupsIfNeeded diff --git a/Signal/translations/en.lproj/Localizable.strings b/Signal/translations/en.lproj/Localizable.strings index 0e17a7b9e..d5a90fc64 100644 --- a/Signal/translations/en.lproj/Localizable.strings +++ b/Signal/translations/en.lproj/Localizable.strings @@ -2607,6 +2607,8 @@ "Update Required" = "Update Required"; "This version of Loki Messenger is no longer supported. Please press OK to reset your account and migrate to the latest version." = "This version of Loki Messenger is no longer supported. Please press OK to reset your account and migrate to the latest version."; "Loki Public Chat" = "Loki Public Chat"; +"Loki News" = "Loki News"; +"Messenger Updates" = "Messenger Updates"; "Show QR Code" = "Show QR Code"; "This is your personal QR code. Other people can scan it to start a secure conversation with you." = "This is your personal QR code. Other people can scan it to start a secure conversation with you."; "Scan a QR Code Instead" = "Scan a QR Code Instead"; diff --git a/SignalServiceKit/src/Loki/API/LokiGroupChat.swift b/SignalServiceKit/src/Loki/API/LokiGroupChat.swift index d9090a585..be6e36213 100644 --- a/SignalServiceKit/src/Loki/API/LokiGroupChat.swift +++ b/SignalServiceKit/src/Loki/API/LokiGroupChat.swift @@ -13,20 +13,15 @@ public final class LokiGroupChat : NSObject { } } - @objc public var isRSS: Bool { - switch kind { - case .publicChat(let id): return false - case .rss(let customID): return true - } + @objc public var isPublicChat: Bool { + if case .publicChat(_) = kind { return true } else { return false } } - @objc public var isPublicChat: Bool { - switch kind { - case .publicChat(let id): return true - case .rss(let customID): return false - } + @objc public var isRSS: Bool { + if case .rss(_) = kind { return true } else { return false } } + // MARK: Kind public enum Kind { case publicChat(id: UInt), rss(customID: String) } // MARK: Initialization