Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Message send bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pvzig committed Feb 2, 2016
1 parent 27f49df commit 7888b0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SlackKit/Sources/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ internal struct Event {
let domain: String?
let emailDomain: String?
let reaction: String?
let replyTo: String?
let replyTo: Double?
let reactions: [[String: AnyObject]]?
let edited: Edited?
let bot: Bot?
Expand Down Expand Up @@ -178,7 +178,7 @@ internal struct Event {
domain = event["domain"] as? String
emailDomain = event["email_domain"] as? String
reaction = event["reaction"] as? String
replyTo = event["reply_to"] as? String
replyTo = event["reply_to"] as? Double
reactions = event["reactions"] as? [[String: AnyObject]]
bot = Bot(bot: event["bot"] as? [String: AnyObject])
edited = Edited(edited:event["edited"] as? [String: AnyObject])
Expand Down
2 changes: 1 addition & 1 deletion SlackKit/Sources/EventHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal struct EventHandler {
//MARK: - Messages

static func messageSent(event: Event) {
if let reply = event.replyTo, message = Client.sharedInstance.sentMessages[reply], channel = message.channel, ts = message.ts {
if let reply = event.replyTo, message = Client.sharedInstance.sentMessages[NSNumber(double: reply).stringValue], channel = message.channel, ts = message.ts {
message.ts = event.ts
message.text = event.text
Client.sharedInstance.channels[channel]?.messages[ts] = message
Expand Down

0 comments on commit 7888b0b

Please sign in to comment.