ObjIRC  Diff

Differences From Artifact [afa44fa97c]:

To Artifact [5544578885]:


150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
	[self sendLineWithFormat: @"JOIN %@", channelName];
}

- (void)leaveChannel: (IRCChannel*)channel
{
	[self leaveChannel: channel
		withReason: nil];
}

- (void)leaveChannel: (IRCChannel*)channel
          withReason: (OFString*)reason
{
	if (reason == nil)
		[self sendLineWithFormat: @"PART %@", [channel name]];
	else
		[self sendLineWithFormat: @"PART %@ :%@",
					  [channel name], reason];








|



|







150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
	[self sendLineWithFormat: @"JOIN %@", channelName];
}

- (void)leaveChannel: (IRCChannel*)channel
{
	[self leaveChannel: channel
		    reason: nil];
}

- (void)leaveChannel: (IRCChannel*)channel
	      reason: (OFString*)reason
{
	if (reason == nil)
		[self sendLineWithFormat: @"PART %@", [channel name]];
	else
		[self sendLineWithFormat: @"PART %@ :%@",
					  [channel name], reason];

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

	[self sendLine: line];

	[pool release];
}

- (void)sendMessage: (OFString*)msg
	  toChannel: (IRCChannel*)channel
{
	[self sendLineWithFormat: @"PRIVMSG %@ :%@", [channel name], msg];
}

- (void)sendMessage: (OFString*)msg
	     toUser: (OFString*)user
{
	[self sendLineWithFormat: @"PRIVMSG %@ :%@", user, msg];
}

- (void)sendNotice: (OFString*)notice
	    toUser: (OFString*)user
{
	[self sendLineWithFormat: @"NOTICE %@ :%@", user, notice];
}

- (void)sendNotice: (OFString*)notice
	 toChannel: (IRCChannel*)channel
{
	[self sendLineWithFormat: @"NOTICE %@ :%@", [channel name], notice];
}

- (void)kickUser: (OFString*)user
     fromChannel: (IRCChannel*)channel
      withReason: (OFString*)reason
{
	[self sendLineWithFormat: @"KICK %@ %@ :%@",
				  [channel name], user, reason];
}

- (void)changeNicknameTo: (OFString*)nickname_
{







|





|





|





|





|
|







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

	[self sendLine: line];

	[pool release];
}

- (void)sendMessage: (OFString*)msg
	    channel: (IRCChannel*)channel
{
	[self sendLineWithFormat: @"PRIVMSG %@ :%@", [channel name], msg];
}

- (void)sendMessage: (OFString*)msg
	       user: (OFString*)user
{
	[self sendLineWithFormat: @"PRIVMSG %@ :%@", user, msg];
}

- (void)sendNotice: (OFString*)notice
	      user: (OFString*)user
{
	[self sendLineWithFormat: @"NOTICE %@ :%@", user, notice];
}

- (void)sendNotice: (OFString*)notice
	   channel: (IRCChannel*)channel
{
	[self sendLineWithFormat: @"NOTICE %@ :%@", [channel name], notice];
}

- (void)kickUser: (OFString*)user
	 channel: (IRCChannel*)channel
	  reason: (OFString*)reason
{
	[self sendLineWithFormat: @"KICK %@ %@ :%@",
				  [channel name], user, reason];
}

- (void)changeNicknameTo: (OFString*)nickname_
{
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
			    of_range(pos + 2, [line length] - pos - 2)];

		[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
			  didSeeUser: user
			leaveChannel: channel
			  withReason: reason];

		return;
	}

	/* KICK */
	if ([action isEqual: @"KICK"] && [components count] >= 4) {
		OFString *who = [components objectAtIndex: 0];







|







345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
			    of_range(pos + 2, [line length] - pos - 2)];

		[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
			  didSeeUser: user
			leaveChannel: channel
			      reason: reason];

		return;
	}

	/* KICK */
	if ([action isEqual: @"KICK"] && [components count] >= 4) {
		OFString *who = [components objectAtIndex: 0];
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
			    of_range(pos + 2, [line length] - pos - 2)];

		[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
			  didSeeUser: user
			    kickUser: whom
			 fromChannel: channel
			  withReason: reason];

		return;
	}

	/* QUIT */
	if ([action isEqual: @"QUIT"] && [components count] >= 2) {
		OFString *who = [components objectAtIndex: 0];







|
|







375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
			    of_range(pos + 2, [line length] - pos - 2)];

		[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
			  didSeeUser: user
			    kickUser: whom
			     channel: channel
			      reason: reason];

		return;
	}

	/* QUIT */
	if ([action isEqual: @"QUIT"] && [components count] >= 2) {
		OFString *who = [components objectAtIndex: 0];
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418

		enumerator = [channels keyEnumerator];
		while ((channel = [enumerator nextObject]) != nil)
			[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
		      didSeeUserQuit: user
			  withReason: reason];

		return;
	}

	/* NICK */
	if ([action isEqual: @"NICK"] && [components count] == 3) {
		OFString *who = [components objectAtIndex: 0];







|







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418

		enumerator = [channels keyEnumerator];
		while ((channel = [enumerator nextObject]) != nil)
			[channel IRC_removeUser: [user nickname]];

		[delegate connection: self
		      didSeeUserQuit: user
			      reason: reason];

		return;
	}

	/* NICK */
	if ([action isEqual: @"NICK"] && [components count] == 3) {
		OFString *who = [components objectAtIndex: 0];
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
		if (![to isEqual: nickname]) {
			IRCChannel *channel;

			channel = [channels objectForKey: to];

			[delegate connection: self
			   didReceiveMessage: msg
				    fromUser: user
				   inChannel: channel];
		} else
			[delegate	  connection: self
			    didReceivePrivateMessage: msg
					    fromUser: user];

		return;
	}

	/* NOTICE */
	if ([action isEqual: @"NOTICE"] && [components count] >= 4) {
		OFString *from = [components objectAtIndex: 0];







|
|



|







465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
		if (![to isEqual: nickname]) {
			IRCChannel *channel;

			channel = [channels objectForKey: to];

			[delegate connection: self
			   didReceiveMessage: msg
					user: user
				     channel: channel];
		} else
			[delegate	  connection: self
			    didReceivePrivateMessage: msg
						user: user];

		return;
	}

	/* NOTICE */
	if ([action isEqual: @"NOTICE"] && [components count] >= 4) {
		OFString *from = [components objectAtIndex: 0];
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
		if (![to isEqual: nickname]) {
			IRCChannel *channel;

			channel = [channels objectForKey: to];

			[delegate connection: self
			    didReceiveNotice: notice
				    fromUser: user
				   inChannel: channel];
		} else
			[delegate connection: self
			    didReceiveNotice: notice
				    fromUser: user];

		return;
	}
}

- (void)processLine: (OFString*)line
{







|
|



|







503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
		if (![to isEqual: nickname]) {
			IRCChannel *channel;

			channel = [channels objectForKey: to];

			[delegate connection: self
			    didReceiveNotice: notice
					user: user
				     channel: channel];
		} else
			[delegate connection: self
			    didReceiveNotice: notice
					user: user];

		return;
	}
}

- (void)processLine: (OFString*)line
{
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
       joinChannel: (IRCChannel*)channel
{
}

- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
      leaveChannel: (IRCChannel*)channel
	withReason: (OFString*)reason
{
}

- (void)connection: (IRCConnection*)connection
        didSeeUser: (IRCUser*)user
  changeNicknameTo: (OFString*)nickname
{
}

- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
	  kickUser: (OFString*)kickedUser
       fromChannel: (IRCChannel*)channel
	withReason: (OFString*)reason
{
}

- (void)connection: (IRCConnection*)connection
    didSeeUserQuit: (IRCUser*)user
	withReason: (OFString*)reason
{
}

-  (void)connection: (IRCConnection*)connection
  didReceiveMessage: (OFString*)msg
	   fromUser: (IRCUser*)user
	  inChannel: (IRCChannel*)channel
{
}

-	  (void)connection: (IRCConnection*)connection
  didReceivePrivateMessage: (OFString*)msg
		  fromUser: (IRCUser*)user
{
}

- (void)connection: (IRCConnection*)connection
  didReceiveNotice: (OFString*)notice
	  fromUser: (IRCUser*)user
{
}

- (void)connection: (IRCConnection*)connection
  didReceiveNotice: (OFString*)notice
	  fromUser: (IRCUser*)user
	 inChannel: (IRCChannel*)channel
{
}

-	   (void)connection: (IRCConnection*)connection
  didReceiveNamesForChannel: (IRCChannel*)channel
{
}

- (void)connectionWasClosed: (IRCConnection*)connection
{
}
@end







|












|
|





|






|





|





|





|
|












601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
       joinChannel: (IRCChannel*)channel
{
}

- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
      leaveChannel: (IRCChannel*)channel
	    reason: (OFString*)reason
{
}

- (void)connection: (IRCConnection*)connection
        didSeeUser: (IRCUser*)user
  changeNicknameTo: (OFString*)nickname
{
}

- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
	  kickUser: (OFString*)kickedUser
	   channel: (IRCChannel*)channel
	    reason: (OFString*)reason
{
}

- (void)connection: (IRCConnection*)connection
    didSeeUserQuit: (IRCUser*)user
	    reason: (OFString*)reason
{
}

-  (void)connection: (IRCConnection*)connection
  didReceiveMessage: (OFString*)msg
	   fromUser: (IRCUser*)user
	    channel: (IRCChannel*)channel
{
}

-	  (void)connection: (IRCConnection*)connection
  didReceivePrivateMessage: (OFString*)msg
		      user: (IRCUser*)user
{
}

- (void)connection: (IRCConnection*)connection
  didReceiveNotice: (OFString*)notice
	      user: (IRCUser*)user
{
}

- (void)connection: (IRCConnection*)connection
  didReceiveNotice: (OFString*)notice
	      user: (IRCUser*)user
	   channel: (IRCChannel*)channel
{
}

-	   (void)connection: (IRCConnection*)connection
  didReceiveNamesForChannel: (IRCChannel*)channel
{
}

- (void)connectionWasClosed: (IRCConnection*)connection
{
}
@end