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

Commit 41c8e42

Browse files
committed
remove slackFormatEscaping
1 parent 920ce9f commit 41c8e42

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

Sources/WebAPI.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ extension WebAPI {
236236
public func sendMessage(
237237
channel: String,
238238
text: String,
239-
escapeCharacters: Bool = true,
240239
username: String? = nil,
241240
asUser: Bool? = nil,
242241
parse: ParseMode? = nil,
@@ -252,7 +251,7 @@ extension WebAPI {
252251
let parameters: [String: Any?] = [
253252
"token": token,
254253
"channel": channel,
255-
"text": escapeCharacters ? text.slackFormatEscaping : text,
254+
"text": text,
256255
"as_user": asUser,
257256
"parse": parse?.rawValue,
258257
"link_names": linkNames,
@@ -274,7 +273,6 @@ extension WebAPI {
274273
channel: String,
275274
thread: String,
276275
text: String,
277-
escapeCharacters: Bool = true,
278276
broadcastReply: Bool = false,
279277
username: String? = nil,
280278
asUser: Bool? = nil,
@@ -292,7 +290,7 @@ extension WebAPI {
292290
"token": token,
293291
"channel": channel,
294292
"thread_ts": thread,
295-
"text": escapeCharacters ? text.slackFormatEscaping : text,
293+
"text": text,
296294
"broadcastReply": broadcastReply,
297295
"as_user": asUser,
298296
"parse": parse?.rawValue,
@@ -314,11 +312,10 @@ extension WebAPI {
314312
public func sendMeMessage(
315313
channel: String,
316314
text: String,
317-
escapeCharacters: Bool = true,
318315
success: (((ts: String?, channel: String?)) -> Void)?,
319316
failure: FailureClosure?
320317
) {
321-
let parameters: [String: Any?] = ["token": token, "channel": channel, "text": escapeCharacters ? text.slackFormatEscaping : text]
318+
let parameters: [String: Any?] = ["token": token, "channel": channel, "text": text]
322319
networkInterface.request(.chatMeMessage, parameters: parameters, successClosure: {(response) in
323320
success?((ts: response["ts"] as? String, response["channel"] as? String))
324321
}) {(error) in
@@ -333,15 +330,14 @@ extension WebAPI {
333330
attachments: [Attachment?]? = nil,
334331
parse: ParseMode = .none,
335332
linkNames: Bool = false,
336-
escapeCharacters: Bool = true,
337333
success: SuccessClosure?,
338334
failure: FailureClosure?
339335
) {
340336
let parameters: [String: Any?] = [
341337
"token": token,
342338
"channel": channel,
343339
"ts": ts,
344-
"text": escapeCharacters ? message.slackFormatEscaping : message,
340+
"text": message,
345341
"parse": parse.rawValue,
346342
"link_names": linkNames,
347343
"attachments": encodeAttachments(attachments)
@@ -456,7 +452,7 @@ extension WebAPI {
456452
// MARK: - File Comments
457453
extension WebAPI {
458454
public func addFileComment(fileID: String, comment: String, success: CommentClosure?, failure: FailureClosure?) {
459-
let parameters: [String: Any] = ["token": token, "file": fileID, "comment": comment.slackFormatEscaping]
455+
let parameters: [String: Any] = ["token": token, "file": fileID, "comment": comment]
460456
networkInterface.request(.filesCommentsAdd, parameters: parameters, successClosure: {(response) in
461457
success?(Comment(comment: response["comment"] as? [String: Any]))
462458
}) {(error) in
@@ -465,7 +461,7 @@ extension WebAPI {
465461
}
466462

467463
public func editFileComment(fileID: String, commentID: String, comment: String, success: CommentClosure?, failure: FailureClosure?) {
468-
let parameters: [String: Any] = ["token": token, "file": fileID, "id": commentID, "comment": comment.slackFormatEscaping]
464+
let parameters: [String: Any] = ["token": token, "file": fileID, "id": commentID, "comment": comment]
469465
networkInterface.request(.filesCommentsEdit, parameters: parameters, successClosure: {(response) in
470466
success?(Comment(comment: response["comment"] as? [String: Any]))
471467
}) {(error) in

0 commit comments

Comments
 (0)