Index: src/IRCConnection.m ================================================================== --- src/IRCConnection.m +++ src/IRCConnection.m @@ -48,11 +48,11 @@ + (instancetype)connection { return [[[self alloc] init] autorelease]; } -- init +- (instancetype)init { self = [super init]; @try { _socketClass = [OFTCPSocket class]; @@ -229,11 +229,11 @@ [self sendLineWithFormat: @"NICK %@", nickname]; objc_autoreleasePoolPop(pool); } -- (void)IRC_processLine: (OFString *)line +- (void)irc_processLine: (OFString *)line { OFArray *components; OFString *action = nil; if ([_delegate respondsToSelector: @@ -275,11 +275,11 @@ @selector(connectionWasEstablished:)]) [_delegate connectionWasEstablished: self]; [OFTimer scheduledTimerWithTimeInterval: _pingInterval target: self - selector: @selector(IRC_sendPing) + selector: @selector(irc_sendPing) repeats: true]; return; } @@ -548,11 +548,11 @@ return; } } -- (void)IRC_sendPing +- (void)irc_sendPing { [_pingData release]; [_pingTimer release]; _pingData = [[OFString alloc] initWithFormat: @":%d", rand()]; @@ -559,15 +559,15 @@ [_socket writeFormat: @"PING %@\r\n", _pingData]; _pingTimer = [[OFTimer scheduledTimerWithTimeInterval: _pingTimeout target: self - selector: @selector(IRC_pingTimeout) + selector: @selector(irc_pingTimeout) repeats: false] retain]; } -- (void)IRC_pingTimeout +- (void)irc_pingTimeout { if ([_delegate respondsToSelector: @selector(connectionWasClosed:)]) [_delegate connectionWasClosed: self]; [_socket cancelAsyncRequests]; @@ -577,47 +577,49 @@ - (void)processLine: (OFString *)line { void *pool = objc_autoreleasePoolPush(); - [self IRC_processLine: line]; + [self irc_processLine: line]; objc_autoreleasePoolPop(pool); } -- (bool)socket: (OFTCPSocket *)socket +- (bool)irc_socket: (OFTCPSocket *)socket didReceiveWronglyEncodedLine: (OFString *)line + context: (id)context exception: (OFException *)exception { if (line != nil) { - [self IRC_processLine: line]; + [self irc_processLine: line]; [socket asyncReadLineWithTarget: self - selector: @selector(socket: - didReceiveLine: + selector: @selector(irc_socket: + didReceiveLine:context: exception:) context: nil]; } return false; } -- (bool)socket: (OFTCPSocket *)socket - didReceiveLine: (OFString *)line - exception: (OFException *)exception +- (bool)irc_socket: (OFTCPSocket *)socket + didReceiveLine: (OFString *)line + context: (id)context + exception: (OFException *)exception { if (line != nil) { - [self IRC_processLine: line]; + [self irc_processLine: line]; return true; } if ([exception isKindOfClass: [OFInvalidEncodingException class]]) { [socket asyncReadLineWithEncoding: _fallbackEncoding target: self - selector: @selector(socket: + selector: @selector(irc_socket: didReceiveWronglyEncodedLine: - exception:) + context:exception:) context: nil]; return false; } if ([_delegate respondsToSelector: @selector(connectionWasClosed:)]) @@ -634,15 +636,15 @@ } - (void)handleConnection { [_socket asyncReadLineWithTarget: self - selector: @selector(socket:didReceiveLine: - exception:) + selector: @selector(irc_socket:didReceiveLine: + context:exception:) context: nil]; } - (OFSet OF_GENERIC(OFString *) *)usersInChannel: (OFString *)channel { return [[[_channels objectForKey: channel] copy] autorelease]; } @end