Changeset 3115
- Timestamp:
- 02/04/06 00:40:58 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cocoa-networking/Chat Core/MVIRCChatConnection.m
r3111 r3115 1099 1099 } 1100 1100 /* 1101 #pragma mark -1102 1103 - (void) _didConnect {1104 id old = _localUser;1105 _localUser = [[MVIRCChatUser allocWithZone:nil] initLocalUserWithConnection:self];1106 [old release];1107 1108 // Identify if we have a user password1109 if( [[self nicknamePassword] length] )1110 [self sendRawMessageWithFormat:@"PRIVMSG NickServ :IDENTIFY %@", [self nicknamePassword]];1111 1112 [super _didConnect];1113 }1114 1101 1115 1102 #pragma mark - … … 1258 1245 - (void) _handle001WithParameters:(NSArray *) parameters fromSender:(MVChatUser *) sender { 1259 1246 [self performSelectorOnMainThread:@selector( _didConnect ) withObject:nil waitUntilDone:NO]; 1247 // Identify if we have a user password 1248 if( [[self nicknamePassword] length] ) 1249 [self sendRawMessageWithFormat:@"NickServ IDENTIFY %@", [self nicknamePassword]]; 1260 1250 if( [parameters count] >= 1 ) { 1261 1251 NSString *nickname = [parameters objectAtIndex:0]; … … 1631 1621 } 1632 1622 1623 - (void) _handleInviteWithParameters:(NSArray *) parameters fromSender:(MVChatUser *) sender { 1624 if( [parameters count] == 2 ) { 1625 id roomName = [parameters objectAtIndex:1]; 1626 if( [roomName isKindOfClass:[NSData class]] ) 1627 roomName = [[[NSString allocWithZone:nil] initWithData:roomName encoding:[self encoding]] autorelease]; 1628 [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:MVChatRoomInvitedNotification object:self userInfo:[NSDictionary dictionaryWithObjectsAndKeys:sender, @"user", roomName, @"room", nil]]; 1629 } 1630 } 1631 1633 1632 - (void) _handleNickWithParameters:(NSArray *) parameters fromSender:(MVChatUser *) sender { 1634 1633 if( [parameters count] == 1 ) { … … 1747 1746 1748 1747 - (void) _handle352WithParameters:(NSArray *) parameters fromSender:(id) sender { // RPL_WHOREPLY 1749 if( [parameters count] >= 6) {1748 if( [parameters count] >= 7 ) { 1750 1749 MVChatRoom *room = [self joinedChatRoomWithName:[parameters objectAtIndex:1]]; 1751 1750 MVChatUser *member = [self chatUserWithUniqueIdentifier:[parameters objectAtIndex:5]]; 1752 1751 [member _setUsername:[parameters objectAtIndex:2]]; 1753 1752 [member _setAddress:[parameters objectAtIndex:3]]; 1753 1754 unichar status = ( [[parameters objectAtIndex:6] length] ? [[parameters objectAtIndex:6] characterAtIndex:0] : 0 ); 1755 if( status == 'H' ) { 1756 [member _setStatus:MVChatUserAvailableStatus]; 1757 } else if( status == 'G' ) { 1758 [member _setStatus:MVChatUserAwayStatus]; 1759 } 1754 1760 } 1755 1761 }
