Differences From Artifact [3268827b82]:
- File tests/test.m — part of check-in [7f37e545cf] at 2012-10-30 20:27:20 on branch trunk — Port to ObjC1. (user: js, size: 3952) [annotate] [blame] [check-ins using]
To Artifact [4612327517]:
- File
tests/test.m
— part of check-in
[620b9b2a30]
at
2012-11-24 11:56:58
on branch trunk
— Remove the IRCChannels class.
It was only overcomplicating things with no gain at all. Instead,
strings are used to describe channels now and the storage of users in a
channel is inside IRCConnection now. (user: js, size: 3965) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 | #import <ObjFW/OFString.h> #import <ObjFW/OFApplication.h> #import <ObjFW/OFFile.h> #import "IRCConnection.h" #import "IRCUser.h" | < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import <ObjFW/OFString.h> #import <ObjFW/OFApplication.h> #import <ObjFW/OFFile.h> #import "IRCConnection.h" #import "IRCUser.h" @interface TestApp: OFObject @end OF_APPLICATION_DELEGATE(TestApp) @implementation TestApp |
︙ | ︙ | |||
63 64 65 66 67 68 69 | - (void)connectionWasEstablished: (IRCConnection*)connection { [connection joinChannel: @"#objfw"]; } - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user | | | | | | | > | < | | > | | | < | | | > | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | - (void)connectionWasEstablished: (IRCConnection*)connection { [connection joinChannel: @"#objfw"]; } - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user joinChannel: (OFString*)channel { of_log(@"%@ joined %@.", user, channel); } - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user leaveChannel: (OFString*)channel reason: (OFString*)reason { of_log(@"%@ left %@ (%@).", user, channel, reason); } - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user kickUser: (OFString*)kickedUser channel: (OFString*)channel reason: (OFString*)reason { of_log(@"%@ kicked %@ from %@: %@", user, kickedUser, channel, reason); } - (void)connection: (IRCConnection*)connection didSeeUserQuit: (IRCUser*)user reason: (OFString*)reason { of_log(@"%@ quit (%@).", user, reason); } - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user changeNicknameTo: (OFString *)nickname { of_log(@"%@ changed nick to %@.", user, nickname); } - (void)connection: (IRCConnection*)connection didReceiveMessage: (OFString*)msg channel: (OFString*)channel user: (IRCUser*)user { of_log(@"[%@] %@: %@", channel, [user nickname], msg); } - (void)connection: (IRCConnection*)connection didReceivePrivateMessage: (OFString*)msg user: (IRCUser*)user { of_log(@"(%@): %@", user, msg); } - (void)connection: (IRCConnection*)connection didReceiveNotice: (OFString*)notice channel: (OFString*)channel user: (IRCUser*)user { of_log(@"NOTICE: [%@] %@: %@", channel, [user nickname], notice); } - (void)connection: (IRCConnection*)connection didReceiveNotice: (OFString*)notice user: (IRCUser*)user { of_log(@"NOTICE: (%@): %@", user, notice); } - (void)connection: (IRCConnection*)connection didReceiveNamesForChannel: (OFString*)channel { of_log(@"Users in %@: %@", channel, [connection usersInChannel: channel]); } @end |