diff --git a/IRC/IRC.swift b/IRC/IRC.swift index 2142320..1144c08 100644 --- a/IRC/IRC.swift +++ b/IRC/IRC.swift @@ -42,6 +42,7 @@ public class IRCChannel { self.server = server } + func receive(_ text: String) { if let delegate = self.delegate { delegate.didRecieveMessage(self, message: text) diff --git a/IRC/IRCServerInputParser.swift b/IRC/IRCServerInputParser.swift index 01d0b9c..232d75e 100644 --- a/IRC/IRCServerInputParser.swift +++ b/IRC/IRCServerInputParser.swift @@ -16,12 +16,12 @@ struct IRCServerInputParser { if message.hasPrefix(":") { let firstSpaceIndex = message.index(of: " ")! - let source = message.substring(to: firstSpaceIndex) - let rest = message.substring(from: firstSpaceIndex).trimmingCharacters(in: .whitespacesAndNewlines) + let source = message[..