diff --git a/Cartfile.resolved b/Cartfile.resolved index c3deb60..5825522 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "pvzig/Starscream" "98d7ccea30621d51a93ee5c155b3f670e37e037b" -github "pvzig/swifter" "8adfae89a6d34cfea1c20d53d8112d1d69e01bd0" +github "pvzig/Starscream" "2fde5c5eb9302439e634753c3aacc794ca2e42e8" +github "pvzig/swifter" "ddbebdde19360a2c9e4e01e5a0642dd12082cc92" diff --git a/SlackKit/Sources/Client+EventHandling.swift b/SlackKit/Sources/Client+EventHandling.swift index ad38aee..4688bdd 100644 --- a/SlackKit/Sources/Client+EventHandling.swift +++ b/SlackKit/Sources/Client+EventHandling.swift @@ -80,11 +80,11 @@ internal extension Client { channelEventsDelegate?.userTyping(self, channel: channel, user: user) let timeout = DispatchTime.now() + Double(Int64(5.0 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC) - DispatchQueue.main.after(when: timeout) { + DispatchQueue.main.asyncAfter(deadline: timeout, execute: { if let index = self.channels[channelID]?.usersTyping.index(of: userID) { self.channels[channelID]?.usersTyping.remove(at: index) } - } + }) } func channelMarked(_ event: Event) { diff --git a/SlackKit/Sources/Client+Utilities.swift b/SlackKit/Sources/Client+Utilities.swift index 26b9f13..0c8d118 100644 --- a/SlackKit/Sources/Client+Utilities.swift +++ b/SlackKit/Sources/Client+Utilities.swift @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -public enum ClientError: ErrorProtocol { +public enum ClientError: Error { case channelDoesNotExist case userDoesNotExist } diff --git a/SlackKit/Sources/Client.swift b/SlackKit/Sources/Client.swift index b80eed8..457bb54 100644 --- a/SlackKit/Sources/Client.swift +++ b/SlackKit/Sources/Client.swift @@ -44,7 +44,7 @@ public final class Client: WebSocketDelegate { } internal var webSocket: WebSocket? - private let pingPongQueue = DispatchQueue(label: "com.launchsoft.SlackKit", attributes: DispatchQueueAttributes.serial) + private let pingPongQueue = DispatchQueue(label: "com.launchsoft.SlackKit") internal var ping: Double? internal var pong: Double? internal var options: ClientOptions? @@ -128,7 +128,7 @@ public final class Client: WebSocketDelegate { //MARK: - RTM Ping private func pingRTMServerAtInterval(_ interval: TimeInterval) { let delay = DispatchTime.now() + Double(Int64(interval * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC) - pingPongQueue.after(when: delay, execute: { + pingPongQueue.asyncAfter(deadline: delay, execute: { guard self.connected && self.timeoutCheck() else { self.disconnect() return diff --git a/SlackKit/Sources/Extensions.swift b/SlackKit/Sources/Extensions.swift index 55f68c4..a0d2049 100644 --- a/SlackKit/Sources/Extensions.swift +++ b/SlackKit/Sources/Extensions.swift @@ -42,7 +42,7 @@ internal extension String { } -internal extension Dictionary where Key: StringLiteralConvertible, Value: AnyObject { +internal extension Dictionary where Key: ExpressibleByStringLiteral, Value: AnyObject { var requestStringFromParameters: String { var requestString = "" diff --git a/SlackKit/Sources/SlackError.swift b/SlackKit/Sources/SlackError.swift index 18faa3a..283ea9b 100644 --- a/SlackKit/Sources/SlackError.swift +++ b/SlackKit/Sources/SlackError.swift @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -public enum SlackError: String, ErrorProtocol { +public enum SlackError: String, Error { case AccountInactive = "account_inactive" case AlreadyArchived = "already_archived" case AlreadyInChannel = "already_in_channel"