From 787adc6c9d538a62e94b4cbbe119022026d81a10 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Fri, 9 Sep 2011 14:55:03 +0000 Subject: [PATCH] Adjust to recent ObjFW changes. FossilOrigin-Name: b2ebf6b9e50512a49a644e6329b96d1facf3075506bf78673d69dc94b161ea2d --- src/IRCConnection.h | 2 +- src/IRCConnection.m | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/IRCConnection.h b/src/IRCConnection.h index 11a1811..b35f0ab 100644 --- a/src/IRCConnection.h +++ b/src/IRCConnection.h @@ -71,6 +71,6 @@ - (void)leaveChannel: (IRCChannel*)channel withReason: (OFString*)reason; - (void)sendLine: (OFString*)line; -- (void)sendLineWithFormat: (OFString*)line, ...; +- (void)sendLineWithFormat: (OFConstantString*)line, ...; - (void)handleConnection; @end diff --git a/src/IRCConnection.m b/src/IRCConnection.m index 111c090..2c702a3 100644 --- a/src/IRCConnection.m +++ b/src/IRCConnection.m @@ -58,7 +58,7 @@ sock = [[OFTCPSocket alloc] init]; [sock connectToHost: server - onPort: port]; + port: port]; [self sendLineWithFormat: @"NICK %@", nickname]; [self sendLineWithFormat: @"USER %@ * 0 :%@", username, realname]; @@ -110,7 +110,7 @@ [sock writeLine: line]; } -- (void)sendLineWithFormat: (OFString*)format, ... +- (void)sendLineWithFormat: (OFConstantString*)format, ... { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFString *line; @@ -180,10 +180,10 @@ IRCUser *user; IRCChannel *channel; - who = [who substringFromIndex: 1 - toIndex: who.length]; - where = [where substringFromIndex: 1 - toIndex: where.length]; + who = [who substringWithRange: + of_range(1, who.length - 1)]; + where = [where substringWithRange: + of_range(1, where.length - 1)]; user = [IRCUser IRCUserWithString: who]; @@ -215,10 +215,10 @@ [[splitted objectAtIndex: 1] length] + 1 + to.length; - from = [from substringFromIndex: 1 - toIndex: from.length]; - msg = [line substringFromIndex: pos + 2 - toIndex: line.length]; + from = [from substringWithRange: + of_range(1, from.length - 1)]; + msg = [line substringWithRange: + of_range(pos + 2, line.length - pos - 2)]; user = [IRCUser IRCUserWithString: from];