diff --git a/Signal/src/AppDelegate.m b/Signal/src/AppDelegate.m
index 048dfe836..e71538795 100644
--- a/Signal/src/AppDelegate.m
+++ b/Signal/src/AppDelegate.m
@@ -1500,7 +1500,7 @@ static NSTimeInterval launchStartedAt;
- (LKRSSFeed *)lokiMessengerUpdatesFeed
{
- return [[LKRSSFeed alloc] initWithId:@"loki.network.messenger-updates" server:@"https://loki.network/category/messenger-updates/feed/" displayName:NSLocalizedString(@"Loki Messenger Updates", @"") isDeletable:false];
+ 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
diff --git a/Signal/src/Loki/LokiRSSFeedPoller.swift b/Signal/src/Loki/LokiRSSFeedPoller.swift
index 4539a851a..4cac9710b 100644
--- a/Signal/src/Loki/LokiRSSFeedPoller.swift
+++ b/Signal/src/Loki/LokiRSSFeedPoller.swift
@@ -35,7 +35,7 @@ public final class LokiRSSFeedPoller : NSObject {
guard let title = item.title, let description = item.description, let date = item.pubDate else { return }
let timestamp = UInt64(date.timeIntervalSince1970 * 1000)
let urlRegex = try! NSRegularExpression(pattern: "]*?\\s+)?href=\"([^\"]*)\".*?>(.*?)<.*?\\/a>")
- var bodyAsHTML = "\(title)
\(description)"
+ var bodyAsHTML = "\(title)
\(description)".replacingOccurrences(of: "
", with: "
")
while true {
guard let match = urlRegex.firstMatch(in: bodyAsHTML, options: [], range: NSRange(location: 0, length: bodyAsHTML.utf16.count)) else { break }
let matchRange = match.range(at: 0)
diff --git a/Signal/src/Loki/NewConversationViewController.swift b/Signal/src/Loki/NewConversationViewController.swift
index 8d41efe70..a7e89efcb 100644
--- a/Signal/src/Loki/NewConversationViewController.swift
+++ b/Signal/src/Loki/NewConversationViewController.swift
@@ -44,7 +44,7 @@ final class NewConversationViewController : OWSViewController, OWSQRScannerDeleg
// Next button
let nextButtonFont = UIFont.ows_dynamicTypeBodyClamped.ows_mediumWeight()
let nextButtonHeight = nextButtonFont.pointSize * 48 / 17
- let nextButton = OWSFlatButton.button(title: NSLocalizedString("Next", comment: ""), font: nextButtonFont, titleColor: .white, backgroundColor: .lokiGreen(), target: self, selector: #selector(startNewConversationIfPossible))
+ let nextButton = OWSFlatButton.button(title: NSLocalizedString("Next", comment: ""), font: nextButtonFont, titleColor: .white, backgroundColor: .lokiGreen(), target: self, selector: #selector(handleNextButtonTapped))
nextButton.autoSetDimension(.height, toSize: nextButtonHeight)
// Stack view
let stackView = UIStackView(arrangedSubviews: [
@@ -95,12 +95,12 @@ final class NewConversationViewController : OWSViewController, OWSQRScannerDeleg
startNewConversationIfPossible(with: hexEncodedPublicKey)
}
- private func handleNextButtonTapped() {
+ @objc private func handleNextButtonTapped() {
let hexEncodedPublicKey = publicKeyTextField.text?.trimmingCharacters(in: .whitespaces) ?? ""
startNewConversationIfPossible(with: hexEncodedPublicKey)
}
- @objc private func startNewConversationIfPossible(with hexEncodedPublicKey: String) {
+ private func startNewConversationIfPossible(with hexEncodedPublicKey: String) {
if !ECKeyPair.isValidHexEncodedPublicKey(candidate: hexEncodedPublicKey) {
let alert = UIAlertController(title: NSLocalizedString("Invalid Public Key", comment: ""), message: NSLocalizedString("Please check the public key you entered and try again.", comment: ""), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil))
diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m
index 58eb2626c..622fa3195 100644
--- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m
+++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m
@@ -564,14 +564,11 @@ typedef enum : NSUInteger {
return !groupThread.isLocalUserInGroup;
}
-- (BOOL)isRSSGroup
+- (BOOL)isRSSFeed
{
- if (![_thread isKindOfClass:[TSGroupThread class]]) {
- return NO;
- }
-
- TSGroupThread *groupThread = (TSGroupThread *)self.thread;
- return groupThread.isRSS;
+ if (![_thread isKindOfClass:[TSGroupThread class]]) { return NO; }
+ TSGroupThread *thread = (TSGroupThread *)self.thread;
+ return thread.isRSSFeed;
}
- (void)hideInputIfNeeded
@@ -582,7 +579,7 @@ typedef enum : NSUInteger {
return;
}
- if (self.userLeftGroup || self.isRSSGroup) {
+ if (self.userLeftGroup || self.isRSSFeed) {
self.inputToolbar.hidden = YES; // user has requested they leave the group. further sends disallowed
[self dismissKeyBoard];
} else {
diff --git a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift
index 6743b9a8a..4cd38c068 100644
--- a/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift
+++ b/Signal/src/ViewControllers/Registration/OnboardingSplashViewController.swift
@@ -14,41 +14,41 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
view.backgroundColor = Theme.backgroundColor
view.layoutMargins = .zero
- let heroImage = UIImage(named: "onboarding_splash_hero")
- let heroImageView = UIImageView(image: heroImage)
- heroImageView.contentMode = .scaleAspectFit
- heroImageView.layer.minificationFilter = .trilinear
- heroImageView.layer.magnificationFilter = .trilinear
- heroImageView.setCompressionResistanceLow()
- heroImageView.setContentHuggingVerticalLow()
- heroImageView.accessibilityIdentifier = "onboarding.splash." + "heroImageView"
-
let titleLabel = self.createTitleLabel(text: NSLocalizedString("Loki Messenger", comment: ""))
view.addSubview(titleLabel)
titleLabel.autoPinEdges(toSuperviewMarginsExcludingEdge: .bottom)
titleLabel.accessibilityIdentifier = "onboarding.splash." + "titleLabel"
- let explanationLabel = UILabel()
- explanationLabel.text = NSLocalizedString("Privacy Policy", comment: "")
- explanationLabel.textColor = .ows_materialBlue
- explanationLabel.font = UIFont.ows_dynamicTypeSubheadlineClamped
- explanationLabel.numberOfLines = 0
- explanationLabel.textAlignment = .center
- explanationLabel.lineBreakMode = .byWordWrapping
- explanationLabel.isUserInteractionEnabled = true
- explanationLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(explanationLabelTapped)))
- explanationLabel.accessibilityIdentifier = "onboarding.splash." + "explanationLabel"
+ let lokiLogo = UIImage(named: "LokiLogo")
+ let lokiLogoImageView = UIImageView(image: lokiLogo)
+ lokiLogoImageView.accessibilityIdentifier = "onboarding.splash." + "lokiLogoImageView"
+ lokiLogoImageView.autoSetDimension(.height, toSize: 71)
+ lokiLogoImageView.contentMode = .scaleAspectFit
+
+ let lokiLogoContainer = UIView()
+ view.setContentHuggingVerticalLow()
+ view.setCompressionResistanceVerticalLow()
+ lokiLogoContainer.addSubview(lokiLogoImageView)
+
+ let privacyPolicyLabel = UILabel()
+ privacyPolicyLabel.text = NSLocalizedString("Privacy Policy", comment: "")
+ privacyPolicyLabel.textColor = .ows_materialBlue
+ privacyPolicyLabel.font = UIFont.ows_dynamicTypeSubheadlineClamped
+ privacyPolicyLabel.numberOfLines = 0
+ privacyPolicyLabel.textAlignment = .center
+ privacyPolicyLabel.lineBreakMode = .byWordWrapping
+ privacyPolicyLabel.isUserInteractionEnabled = true
+ privacyPolicyLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(explanationLabelTapped)))
+ privacyPolicyLabel.accessibilityIdentifier = "onboarding.splash." + "explanationLabel"
- let continueButton = self.createButton(title: NSLocalizedString("BUTTON_CONTINUE",
- comment: "Label for 'continue' button."),
- selector: #selector(continuePressed))
+ let continueButton = self.createButton(title: NSLocalizedString("BUTTON_CONTINUE", comment: "Label for 'continue' button."), selector: #selector(continuePressed))
view.addSubview(continueButton)
continueButton.accessibilityIdentifier = "onboarding.splash." + "continueButton"
-
+
let stackView = UIStackView(arrangedSubviews: [
titleLabel,
- UIView.vStretchingSpacer(),
- explanationLabel,
+ lokiLogoContainer,
+ privacyPolicyLabel,
UIView.spacer(withHeight: 24),
continueButton
])
@@ -60,6 +60,7 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
stackView.autoPinWidthToSuperview()
stackView.autoPin(toTopLayoutGuideOf: self, withInset: 0)
stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
+ lokiLogoImageView.autoCenterInSuperview()
}
// MARK: - Events
diff --git a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h
index 8fb376da2..e38fa3314 100644
--- a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h
+++ b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.h
@@ -16,7 +16,7 @@ extern NSString *const TSGroupThread_NotificationKey_UniqueId;
@interface TSGroupThread : TSThread
@property (nonatomic, strong) TSGroupModel *groupModel;
-@property (nonatomic, readonly) BOOL isRSS;
+@property (nonatomic, readonly) BOOL isRSSFeed;
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel;
+ (instancetype)getOrCreateThreadWithGroupModel:(TSGroupModel *)groupModel
diff --git a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m
index 7110d7921..c7b5b135a 100644
--- a/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m
+++ b/SignalServiceKit/src/Contacts/Threads/TSGroupThread.m
@@ -266,10 +266,10 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific
return [self.class stableColorNameForNewConversationWithString:[self threadIdFromGroupId:groupId]];
}
-- (BOOL)isRSS
+- (BOOL)isRSSFeed
{
NSString *groupID = [[NSString alloc] initWithData:self.groupModel.groupId encoding:NSUTF8StringEncoding];
- return groupID != nil && [groupID containsString:@"rss:"];
+ return groupID != nil && [groupID hasPrefix:@"rss://"];
}
@end
diff --git a/SignalServiceKit/src/Loki/API/LokiAPI.swift b/SignalServiceKit/src/Loki/API/LokiAPI.swift
index a79a45eac..04e74f481 100644
--- a/SignalServiceKit/src/Loki/API/LokiAPI.swift
+++ b/SignalServiceKit/src/Loki/API/LokiAPI.swift
@@ -12,7 +12,7 @@ public final class LokiAPI : NSObject {
private static let defaultTimeout: TimeInterval = 20
private static let longPollingTimeout: TimeInterval = 40
public static let defaultMessageTTL: UInt64 = 24 * 60 * 60 * 1000
- internal static var powDifficulty: UInt = 100
+ internal static var powDifficulty: UInt = 40
// MARK: Types
public typealias RawResponse = Any