This commit is contained in:
Ali
2020-11-24 19:50:25 +04:00
parent b2f3ed1491
commit 2c7185763e
20 changed files with 620 additions and 286 deletions

View File

@@ -10,78 +10,28 @@ public enum PeerInputActivity: Comparable {
case playingGame
case recordingInstantVideo
case uploadingInstantVideo(progress: Int32)
public static func ==(lhs: PeerInputActivity, rhs: PeerInputActivity) -> Bool {
switch lhs {
case .typingText:
if case .typingText = rhs {
return true
} else {
return false
}
case let .uploadingFile(progress):
if case .uploadingFile(progress) = rhs {
return true
} else {
return false
}
case .recordingVoice:
if case .recordingVoice = rhs {
return true
} else {
return false
}
case .playingGame:
if case .playingGame = rhs {
return true
} else {
return false
}
case .uploadingPhoto(let progress):
if case .uploadingPhoto(progress) = rhs {
return true
} else {
return false
}
case .uploadingVideo(let progress):
if case .uploadingVideo(progress) = rhs {
return true
} else {
return false
}
case .recordingInstantVideo:
if case .recordingInstantVideo = rhs {
return true
} else {
return false
}
case .uploadingInstantVideo(let progress):
if case .uploadingInstantVideo(progress) = rhs {
return true
} else {
return false
}
}
}
case speakingInGroupCall
public var key: Int32 {
switch self {
case .typingText:
return 0
case .uploadingFile:
case .speakingInGroupCall:
return 1
case .recordingVoice:
case .uploadingFile:
return 2
case .uploadingPhoto:
case .recordingVoice:
return 3
case .uploadingVideo:
case .uploadingPhoto:
return 4
case .recordingInstantVideo:
case .uploadingVideo:
return 5
case .uploadingInstantVideo:
case .recordingInstantVideo:
return 6
case .playingGame:
case .uploadingInstantVideo:
return 7
case .playingGame:
return 8
}
}
@@ -111,6 +61,8 @@ extension PeerInputActivity {
self = .recordingInstantVideo
case let .sendMessageUploadRoundAction(progress):
self = .uploadingInstantVideo(progress: progress)
case .speakingInGroupCallAction:
self = .speakingInGroupCall
}
}
}