Overview
Context
Changes
Modified src/IRCConnection.h
from [7791c3eea9]
to [26bbbf5e84].
︙ | | |
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-
+
-
+
-
-
+
+
+
+
+
+
-
+
-
+
|
@class OFTCPSocket;
@class IRCConnection;
@class IRCUser;
@class IRCChannel;
@protocol IRCConnectionDelegate
@optional
- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
didReceiveLine: (OFString*)line;
- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
didSendLine: (OFString*)line;
- (void)connectionWasEstablished: (IRCConnection*)conn;
- (void)connection: (IRCConnection*)conn
- (void)connectionWasEstablished: (IRCConnection*)connection;
- (void)connection: (IRCConnection*)connection
didSeeUser: (IRCUser*)user
joinChannel: (IRCChannel*)channel;
- (void)connection: (IRCConnection*)connection
didSeeUser: (IRCUser*)user
leaveChannel: (IRCChannel*)channel
withReason: (OFString*)reason;
- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
didReceiveMessage: (OFString*)msg
fromUser: (IRCUser*)user
inChannel: (IRCChannel*)channel;
- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
didReceivePrivateMessage: (OFString*)msg
fromUser: (IRCUser*)user;
@end
@interface IRCConnection: OFObject
{
OFTCPSocket *sock;
|
︙ | | |
Modified src/IRCConnection.m
from [4ee7d8dea1]
to [0c31043ae7].
︙ | | |
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
OFString *who = [splitted objectAtIndex: 0];
OFString *where = [splitted objectAtIndex: 2];
IRCUser *user;
IRCChannel *channel;
who = [who substringWithRange:
of_range(1, who.length - 1)];
where = [where substringWithRange:
of_range(1, where.length - 1)];
user = [IRCUser IRCUserWithString: who];
if ([who hasPrefix:
[nickname stringByAppendingString: @"!"]]) {
channel = [IRCChannel channelWithName: where];
[channels setObject: channel
forKey: where];
} else
channel = [channels objectForKey: where];
if ([delegate respondsToSelector:
@selector(connection:didSeeUser:joinChannel:)])
[delegate connection: self
didSeeUser: user
joinChannel: channel];
continue;
}
/* PART */
if (splitted.count >= 3 &&
[[splitted objectAtIndex: 1] isEqual: @"PART"]) {
OFString *who = [splitted objectAtIndex: 0];
OFString *where = [splitted objectAtIndex: 2];
IRCUser *user;
IRCChannel *channel;
OFString *reason = nil;
size_t pos = who.length + 1 +
[[splitted objectAtIndex: 1] length] + 1 +
where.length;
who = [who substringWithRange:
of_range(1, who.length - 1)];
user = [IRCUser IRCUserWithString: who];
channel = [channels objectForKey: where];
if (splitted.count > 3)
reason = [line substringWithRange:
of_range(pos + 2, line.length - pos - 2)];
if ([delegate respondsToSelector:
@selector(connection:didSeeUser:leaveChannel:
withReason:)])
[delegate connection: self
didSeeUser: user
leaveChannel: channel
withReason: reason];
continue;
}
/* PRIVMSG */
if (splitted.count >= 4 &&
[[splitted objectAtIndex: 1] isEqual: @"PRIVMSG"]) {
OFString *from = [splitted objectAtIndex: 0];
|
︙ | | |