Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

temporary additional info #712

Merged
merged 2 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DcCore/DcCore/DC/Wrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class DcContext {
public var logger: Logger?
let contextPointer: OpaquePointer
public var lastErrorString: String?
public var lastWarningString: String = "" // temporary thing to get a grip on some weird errors
public var maxConfigureProgress: Int = 0 // temporary thing to get a grip on some weird errors

private init() {
var version = ""
Expand Down Expand Up @@ -292,6 +294,8 @@ public class DcContext {
}

public func configure() {
maxConfigureProgress = 0
lastWarningString = ""
dc_configure(contextPointer)
}

Expand Down
2 changes: 2 additions & 0 deletions DcCore/DcCore/DC/events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon

case DC_EVENT_WARNING:
let s = String(cString: data2String)
DcContext.shared.lastWarningString = s
DcContext.shared.logger?.warning("event: \(s)")

case DC_EVENT_CONFIGURE_PROGRESS:
DcContext.shared.maxConfigureProgress = max(DcContext.shared.maxConfigureProgress, Int(data1))
DcContext.shared.logger?.info("configure progress: \(Int(data1)) \(Int(data2))")
let nc = NotificationCenter.default
DispatchQueue.main.async {
Expand Down
2 changes: 2 additions & 0 deletions deltachat-ios/Controller/AccountSetupController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
var errorMessage = ui["errorMessage"] as? String
if let appDelegate = UIApplication.shared.delegate as? AppDelegate, appDelegate.reachability.connection == .none {
errorMessage = String.localized("login_error_no_internet_connection")
} else {
errorMessage = "\(errorMessage ?? "no message")\n\n(warning=\(DcContext.shared.lastWarningString) (progress=\(DcContext.shared.maxConfigureProgress))"
}
self.updateProgressAlert(error: errorMessage)
} else if ui["done"] as! Bool {
Expand Down