Update tests.

FossilOrigin-Name: 7dcca7532edf47daaee740b56e22ea65c9c6746826edc226800f4491bd134160
This commit is contained in:
Jonathan Schleifer 2011-09-09 16:29:45 +00:00
parent 8e1e22cbf7
commit 393e3f78e8

View file

@ -36,51 +36,59 @@ OF_APPLICATION_DELEGATE(TestApp)
@implementation TestApp @implementation TestApp
- (void)applicationDidFinishLaunching - (void)applicationDidFinishLaunching
{ {
IRCConnection *conn = [[IRCConnection alloc] init]; IRCConnection *connection = [[IRCConnection alloc] init];
conn.server = @"leguin.freenode.net"; connection.server = @"irc.freenode.net";
conn.nickname = @"ObjIRC"; connection.nickname = @"ObjIRC";
conn.username = @"ObjIRC"; connection.username = @"ObjIRC";
conn.realname = @"ObjIRC"; connection.realname = @"ObjIRC";
conn.delegate = self; connection.delegate = self;
[conn connect]; [connection connect];
[conn handleConnection]; [connection handleConnection];
} }
- (void)connection: (IRCConnection*)conn - (void)connection: (IRCConnection*)connection
didReceiveLine: (OFString*)line didReceiveLine: (OFString*)line
{ {
[of_stderr writeFormat: @"> %@\n", line]; [of_stderr writeFormat: @"> %@\n", line];
} }
- (void)connection: (IRCConnection*)conn - (void)connection: (IRCConnection*)connection
didSendLine: (OFString*)line didSendLine: (OFString*)line
{ {
[of_stderr writeFormat: @"< %@\n", line]; [of_stderr writeFormat: @"< %@\n", line];
} }
- (void)connectionWasEstablished: (IRCConnection*)conn - (void)connectionWasEstablished: (IRCConnection*)connection
{ {
[conn joinChannel: @"#objfw"]; [connection joinChannel: @"#objfw"];
} }
- (void)connection: (IRCConnection*)conn - (void)connection: (IRCConnection*)connection
didSeeUser: (IRCUser*)user didSeeUser: (IRCUser*)user
joinChannel: (IRCChannel*)channel joinChannel: (IRCChannel*)channel
{ {
of_log(@"%@ joined %@.", user, channel.name); of_log(@"%@ joined %@.", user, channel);
} }
- (void)connection: (IRCConnection*)conn - (void)connection: (IRCConnection*)connection
didSeeUser: (IRCUser*)user
leaveChannel: (IRCChannel*)channel
withReason: (OFString*)reason
{
of_log(@"%@ left %@ (%@).", user, channel, reason);
}
- (void)connection: (IRCConnection*)connection
didReceiveMessage: (OFString*)msg didReceiveMessage: (OFString*)msg
fromUser: (IRCUser*)user fromUser: (IRCUser*)user
inChannel: (IRCChannel*)channel inChannel: (IRCChannel*)channel
{ {
of_log(@"[%@] %@: %@", channel.name, user, msg); of_log(@"[%@] %@: %@", channel, user, msg);
} }
- (void)connection: (IRCConnection*)conn - (void)connection: (IRCConnection*)connection
didReceivePrivateMessage: (OFString*)msg didReceivePrivateMessage: (OFString*)msg
fromUser: (IRCUser*)user fromUser: (IRCUser*)user
{ {