Skip to content

Commit

Permalink
Merge branch 'release/3.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeger committed Jan 26, 2018
2 parents 20caac1 + 7663cc9 commit 9eeebae
Show file tree
Hide file tree
Showing 210 changed files with 12,675 additions and 9,980 deletions.
4 changes: 2 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github "wireapp/CocoaLumberjack" ~> 3.3
github "wireapp/Cartography" ~> 1.1
github "wireapp/TTTAttributedLabel" "2.0.0-swift3.0.2"
github "wireapp/ZipArchive" ~> 2.0
github "wireapp/wire-ios-share-engine" ~> 56.0
github "wireapp/wire-ios-sync-engine" ~> 135.0
github "wireapp/wire-ios-share-engine" ~> 59.0
github "wireapp/wire-ios-sync-engine" "138.0.1-hotfix-2"
github "wireapp/onepassword-app-extension" "framework/1.8.2-wire-swift3.0.2"
github "wireapp/FormatterKit" "1.8.1-swift3.0.2"
github "wireapp/AFNetworking" "2.6.3-iOS8"
Expand Down
12 changes: 6 additions & 6 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ github "wireapp/PINCache" "2.3-swift3.1"
github "wireapp/PureLayout" "v3.0.0"
github "wireapp/TTTAttributedLabel" "2.0.0-swift3.0.2"
github "wireapp/ZipArchive" "v2.0.8"
github "wireapp/avs-ios-binaries" "3.6.117"
github "wireapp/avs-ios-binaries" "4.0.128"
github "wireapp/ios-snapshot-test-case" "2.1.4-swift3.1"
github "wireapp/libPhoneNumber-iOS" "0.9.2-swift3.1"
github "wireapp/mixpanel-swift" "v2.2.2"
Expand All @@ -20,14 +20,14 @@ github "wireapp/ono" "1.4.0"
github "wireapp/protobuf-objc" "1.9.14"
github "wireapp/wire-ios-canvas" "5.0.1"
github "wireapp/wire-ios-cryptobox" "11.0.1"
github "wireapp/wire-ios-data-model" "84.1.0"
github "wireapp/wire-ios-data-model" "86.0.0"
github "wireapp/wire-ios-images" "12.0.1"
github "wireapp/wire-ios-link-preview" "7.0.1"
github "wireapp/wire-ios-message-strategy" "70.0.0"
github "wireapp/wire-ios-message-strategy" "72.0.0"
github "wireapp/wire-ios-protos" "13.0.0"
github "wireapp/wire-ios-request-strategy" "69.0.0"
github "wireapp/wire-ios-share-engine" "56.0.0"
github "wireapp/wire-ios-sync-engine" "135.0.3"
github "wireapp/wire-ios-request-strategy" "71.0.0"
github "wireapp/wire-ios-share-engine" "59.0.0"
github "wireapp/wire-ios-sync-engine" "138.0.1-hotfix-3"
github "wireapp/wire-ios-system" "19.0.1"
github "wireapp/wire-ios-transport" "30.2.1"
github "wireapp/wire-ios-utilities" "18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion ConfigurationSets/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// along with this program. If not, see https://www.gnu.org/licenses/.
//

WIRE_SHORT_VERSION = 3.5
WIRE_SHORT_VERSION = 3.6
36 changes: 23 additions & 13 deletions Wire-iOS Share Extension/ShareExtensionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import Classy
/// The delay after which a progess view controller will be displayed if all messages are not yet sent.
private let progressDisplayDelay: TimeInterval = 0.5

private enum LocalAuthenticationStatus {
case disabled
case denied
case granted
}

class ShareExtensionViewController: SLComposeServiceViewController {

lazy var accountItem : SLComposeSheetConfigurationItem = { [weak self] in
Expand Down Expand Up @@ -58,7 +64,7 @@ class ShareExtensionViewController: SLComposeServiceViewController {
fileprivate var sharingSession: SharingSession? = nil
fileprivate var extensionActivity: ExtensionActivity? = nil
fileprivate var currentAccount: Account? = nil

fileprivate var localAuthenticationStatus: LocalAuthenticationStatus = .disabled
private var observer: SendableBatchObserver? = nil
private weak var progressViewController: SendingProgressViewController? = nil

Expand Down Expand Up @@ -310,16 +316,16 @@ class ShareExtensionViewController: SLComposeServiceViewController {
}

private func presentChooseAccount() {
requireLocalAuthenticationIfNeeded(with: { [weak self] (granted) in
if granted == nil || (granted != nil && granted!) {
requireLocalAuthenticationIfNeeded(with: { [weak self] (status) in
if let status = status, status != .denied {
self?.showChooseAccount()
}
})
}

private func presentChooseConversation() {
requireLocalAuthenticationIfNeeded(with: { [weak self] (granted) in
if granted == nil || (granted != nil && granted!) {
requireLocalAuthenticationIfNeeded(with: { [weak self] (status) in
if let status = status, status != .denied {
self?.showChooseConversation()
}
})
Expand Down Expand Up @@ -356,27 +362,31 @@ class ShareExtensionViewController: SLComposeServiceViewController {
pushConfigurationViewController(accountSelectionViewController)
}

/// @param callback confirmation; if the auth is not needed or is not possible on the current device called with '.none'
func requireLocalAuthenticationIfNeeded(with callback: @escaping (Bool?)->()) {
/// @param callback confirmation; called when authentication evaluation is completed.
fileprivate func requireLocalAuthenticationIfNeeded(with callback: @escaping (LocalAuthenticationStatus?)->()) {

// I need to store the current authentication in order to avoid future authentication requests in the same Share Extension session

guard AppLock.isActive else {
callback(.none)
localAuthenticationStatus = .disabled
callback(localAuthenticationStatus)
return
}

guard let session = sharingSession, !session.isLocalAuthenticationGranted else {
callback(true)
guard localAuthenticationStatus != .granted else {
callback(localAuthenticationStatus)
return
}

AppLock.evaluateAuthentication(description: "share_extension.privacy_security.lock_app.description".localized) { (success, error) in
AppLock.evaluateAuthentication(description: "share_extension.privacy_security.lock_app.description".localized) { [weak self] (success, error) in
DispatchQueue.main.async {
callback(success)
if let success = success, success {
session.isLocalAuthenticationGranted = success
self?.localAuthenticationStatus = .granted
} else {
self?.localAuthenticationStatus = .denied
DDLogError("Local authentication error: \(String(describing: error?.localizedDescription))")
}
callback(self?.localAuthenticationStatus)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Wire-iOS Share Extension/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@



"share_extension.conversation_selection.account" = "Account:";
"share_extension.conversation_selection.account" = "Cuenta:";
"share_extension.conversation_selection.title" = "Chat:";
"share_extension.send_button.title" = "Enviar";
"share_extension.conversation_selection.empty.value" = "Seleccionar";
Expand All @@ -30,8 +30,8 @@
"share_extension.no_internet_connection.title" = "No hay conexión a Internet";
"share_extension.not_signed_in.title" = "Para compartir contenidos debes registrarte en Wire";
"share_extension.not_signed_in.close_button" = "Cerrar";
"share_extension.timeout.title" = "The connection has timed out.";
"share_extension.timeout.message" = "Check your Internet connection and try again. The attachments were saved in the conversation.";
"share_extension.timeout.title" = "La conexión expiró.";
"share_extension.timeout.message" = "Verifica la conexión a Internet e intenta nuevamente. Los archivos adjuntos se guardaron en la conversación.";
"share_extension.privacy_security.lock_app.description" = "Desbloquear Wire";

"conversation.displayname.emptygroup" = "Chat de grupo vacío";
Expand Down
2 changes: 1 addition & 1 deletion Wire-iOS Share Extension/lt.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@



"share_extension.conversation_selection.account" = "Account:";
"share_extension.conversation_selection.account" = "Paskyra:";
"share_extension.conversation_selection.title" = "Pokalbis:";
"share_extension.send_button.title" = "Siųsti";
"share_extension.conversation_selection.empty.value" = "Pasirinkti";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ final class AccessoryTextFieldTests: ZMSnapshotTestCase {
// GIVEN

// WHEN
sut.placeholder = "team name"
sut.placeholder = "TEAM NAME"

// THEN
self.verify(view: sut.snapshotView())
Expand Down
4 changes: 2 additions & 2 deletions Wire-iOS Tests/AccountViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ class AccountViewTests: ZMSnapshotTestCase {

func testThatItShowsBasicAccountWithPicture_Team() {
// GIVEN
let account = Account(userName: "Iggy Pop", userIdentifier: UUID(), teamName: "Wire", imageData: UIImageJPEGRepresentation(self.image(inTestBundleNamed: "unsplash_matterhorn.jpg"), 0.9))
let account = Account(userName: "Iggy Pop", userIdentifier: UUID(), teamName: "Wire", imageData: nil, teamImageData: UIImageJPEGRepresentation(self.image(inTestBundleNamed: "unsplash_matterhorn.jpg"), 0.9))
let sut = TeamAccountView(account: account)
// WHEN && THEN
self.verify(view: sut.snapshotView())
}

func testThatItShowsBasicAccountWithPictureSelected_Team() {
// GIVEN
let account = Account(userName: "Iggy Pop", userIdentifier: UUID(), teamName: "Wire", imageData: UIImageJPEGRepresentation(self.image(inTestBundleNamed: "unsplash_matterhorn.jpg"), 0.9))
let account = Account(userName: "Iggy Pop", userIdentifier: UUID(), teamName: "Wire", imageData: nil, teamImageData: UIImageJPEGRepresentation(self.image(inTestBundleNamed: "unsplash_matterhorn.jpg"), 0.9))
let sut = TeamAccountView(account: account)
// WHEN
sut.selected = true
Expand Down
18 changes: 14 additions & 4 deletions Wire-iOS Tests/AnalyticsMixpanelProviderTests.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
//
// AnalyticsMixpanelProviderTests.swift
// Wire-iOS-Tests
// Wire
// Copyright (C) 2017 Wire Swiss GmbH
//
// Created by John Nguyen on 29.11.17.
// Copyright © 2017 Zeta Project Germany GmbH. All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see https://www.gnu.org/licenses/.
//

import XCTest
Expand Down
2 changes: 1 addition & 1 deletion Wire-iOS Tests/AvailabilityTitleViewTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class AvailabilityTitleViewTests: ZMSnapshotTestCase {
updateAvailability(for: user, newValue: availability)
self.sut = AvailabilityTitleView(user: user, style: style)
guard let sut = self.sut else { XCTFail(); return }
sut.configure()
sut.configure(user: user)

switch style {
case .header, .selfProfile: sut.backgroundColor = .black
Expand Down
Loading

0 comments on commit 9eeebae

Please sign in to comment.