Fix merge.
The changes to SignalCall must have been lost as I tried to apply swift lint to them. // FREEBIE
This commit is contained in:
parent
ca27d10cd4
commit
ada6da9506
@ -41,6 +41,16 @@ protocol CallDelegate: class {
|
||||
var state: CallState {
|
||||
didSet {
|
||||
Logger.debug("\(TAG) state changed: \(oldValue) -> \(state)")
|
||||
|
||||
// Update connectedDate
|
||||
if state == .connected {
|
||||
if connectedDate == nil {
|
||||
connectedDate = NSDate()
|
||||
}
|
||||
} else {
|
||||
connectedDate = nil
|
||||
}
|
||||
|
||||
delegate?.stateDidChange(call: self, state: state)
|
||||
}
|
||||
}
|
||||
@ -50,6 +60,7 @@ protocol CallDelegate: class {
|
||||
delegate?.muteDidChange(call: self, isMuted: isMuted)
|
||||
}
|
||||
}
|
||||
var connectedDate: NSDate?
|
||||
|
||||
var error: CallError?
|
||||
|
||||
@ -76,6 +87,11 @@ protocol CallDelegate: class {
|
||||
static func newCallSignalingId() -> UInt64 {
|
||||
return UInt64.ows_random()
|
||||
}
|
||||
|
||||
// This method should only be called when the call state is "connected".
|
||||
func connectionDuration() -> TimeInterval {
|
||||
return -connectedDate!.timeIntervalSinceNow
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension UInt64 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user