| -(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) return nil; | |||||
| if (!(self = [super init])) | |||||
| return nil; | |||||
| _irc_session = irc_session; | _irc_session = irc_session; | ||||
| -(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]; | ||||
| // TODO: but what if it was us? the delegate handles it...? or do we do | |||||
| // something here? | |||||
| } 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 | |||||
| // something here? | |||||
| } | |||||
| [_delegate userParted:nick | [_delegate userParted:nick | ||||
| channel:self | channel:self | ||||
| 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]; | ||||
| // TODO: but what if it was us? the delegate handles it...? or do we do | |||||
| // something here? | |||||
| } 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 | |||||
| // something here? | |||||
| } | |||||
| [_delegate userKicked:nick | [_delegate userKicked:nick | ||||
| fromChannel:self | fromChannel:self |