Send non opaque images from pasteboard as stickers

Language suggestion alert
Ability to create new contact from "tel:"-link context menu and chat search
Upload date display for profile pictures
Instant View improvements
This commit is contained in:
Ilya Laktyushin
2018-11-11 18:03:00 +04:00
parent 5dc7781fb9
commit cc17271034
75 changed files with 2526 additions and 1399 deletions

View File

@@ -21,6 +21,7 @@ final class AuthorizationSequenceSplashController: ViewController {
var nextPressed: ((PresentationStrings?) -> Void)?
private let suggestedLocalization = Promise<SuggestedLocalizationInfo?>(nil)
private let activateLocalizationDisposable = MetaDisposable()
init(postbox: Postbox, network: Network, theme: AuthorizationTheme) {
@@ -28,8 +29,11 @@ final class AuthorizationSequenceSplashController: ViewController {
self.network = network
self.theme = theme
self.suggestedLocalization.set(currentlySuggestedLocalization(network: network, extractKeys: ["Login.ContinueWithLocalization"]))
let suggestedLocalization = self.suggestedLocalization
let localizationSignal = SSignal(generator: { subscriber in
let disposable = currentlySuggestedLocalization(network: network, extractKeys: ["Login.ContinueWithLocalization"]).start(next: { localization in
let disposable = suggestedLocalization.get().start(next: { localization in
guard let localization = localization else {
return
}
@@ -138,17 +142,27 @@ final class AuthorizationSequenceSplashController: ViewController {
}
private func activateLocalization(_ code: String) {
let _ = (postbox.transaction { transaction -> String in
let currentCode = self.postbox.transaction { transaction -> String in
if let current = transaction.getPreferencesEntry(key: PreferencesKeys.localizationSettings) as? LocalizationSettings {
return current.primaryComponent.languageCode
} else {
return "en"
}
} |> deliverOnMainQueue).start(next: { [weak self] currentCode in
}
let suggestedCode = self.suggestedLocalization.get()
|> map { localization -> String? in
return localization?.availableLocalizations.first?.languageCode
}
let _ = (combineLatest(currentCode, suggestedCode) |> deliverOnMainQueue).start(next: { [weak self] currentCode, suggestedCode in
guard let strongSelf = self else {
return
}
if let suggestedCode = suggestedCode {
_ = markSuggestedLocalizationAsSeenInteractively(postbox: strongSelf.postbox, languageCode: suggestedCode).start()
}
if currentCode == code {
strongSelf.nextPressed?(nil)
return