Prep for future functionality; added comments

This commit is contained in:
achmizs 2021-12-05 15:40:29 -05:00
parent 88b7ef1582
commit d08c081729

View File

@ -57,8 +57,8 @@
-(instancetype) initWithName:(NSData *)name -(instancetype) initWithName:(NSData *)name
andIRCSession:(irc_session_t *)irc_session { andIRCSession:(irc_session_t *)irc_session {
self = [super init]; if (!(self = [super init]))
if (!self) return nil; return nil;
_irc_session = irc_session; _irc_session = irc_session;
@ -203,10 +203,15 @@
-(void) userParted:(NSData *)nick -(void) userParted:(NSData *)nick
withReason:(NSData *)reason withReason:(NSData *)reason
us:(BOOL)wasItUs { us:(BOOL)wasItUs {
if (!wasItUs) if (!wasItUs) {
[_nicks removeObject:nick]; [_nicks removeObject:nick];
} else {
// NOTE: When the channel object receives this message, and wasItUs
// is true, its session has already removed the channel from its list
// of channels.
// TODO: but what if it was us? the delegate handles it...? or do we do // TODO: but what if it was us? the delegate handles it...? or do we do
// something here? // something here?
}
[_delegate userParted:nick [_delegate userParted:nick
channel:self channel:self
@ -240,10 +245,15 @@
withReason:(NSData *)reason withReason:(NSData *)reason
by:(NSData *)byNick by:(NSData *)byNick
us:(BOOL)wasItUs { us:(BOOL)wasItUs {
if (!wasItUs) if (!wasItUs) {
[_nicks removeObject:nick]; [_nicks removeObject:nick];
} else {
// NOTE: When the channel object receives this message, and wasItUs
// is true, its session has already removed the channel from its list
// of channels.
// TODO: but what if it was us? the delegate handles it...? or do we do // TODO: but what if it was us? the delegate handles it...? or do we do
// something here? // something here?
}
[_delegate userKicked:nick [_delegate userKicked:nick
fromChannel:self fromChannel:self