Skip to content
This repository has been archived by the owner on Jan 28, 2019. It is now read-only.

Commit

Permalink
Linting clean up and Swift 4 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pvzig committed Feb 8, 2018
1 parent 11919d0 commit aaa6d91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Sources/SKRTMAPI/Conformers/VaporEngineRTM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import URI
import WebSockets

public class VaporEngineRTM: RTMWebSocket {
public var delegate: RTMDelegate?
public weak var delegate: RTMDelegate?

public required init(){}
public required init() {}

private var websocket: WebSocket?

Expand All @@ -41,7 +41,7 @@ public class VaporEngineRTM: RTMWebSocket {
let headers: [HeaderKey: String] = [:]
let protocols: [String]? = nil
do {
let uri = try! URI(url.absoluteString)
let uri = try URI(url.absoluteString)
if uri.scheme.isSecure {
let tcp = try TCPInternetSocket(
scheme: "https",
Expand Down Expand Up @@ -75,7 +75,7 @@ public class VaporEngineRTM: RTMWebSocket {
}
}

func didConnect(websocket: WebSocket) throws -> Void {
func didConnect(websocket: WebSocket) throws {
self.websocket = websocket

self.delegate?.didConnect()
Expand All @@ -84,7 +84,7 @@ public class VaporEngineRTM: RTMWebSocket {
self.delegate?.receivedMessage(text)
}

websocket.onClose = { ws in
websocket.onClose = { ws, _, _, close in
self.delegate?.disconnected()
}

Expand Down
7 changes: 6 additions & 1 deletion Sources/SKRTMAPI/SKRTMAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ public final class SKRTMAPI: RTMDelegate {
self.adapter?.initialSetup(json: response, instance: self)
}

private func format(message: String, channel: String, id: String? = nil, threadTs: String? = nil, broadcastReply: Bool = false) throws -> String {
private func format(message: String,
channel: String,
id: String? = nil,
threadTs: String? = nil,
broadcastReply: Bool = false
) throws -> String {
let json: [String: Any?] = [
"id": id ?? Date().slackTimestamp,
"type": "message",
Expand Down

0 comments on commit aaa6d91

Please sign in to comment.