| 267 | | NSString *uniqueIdentfier = [identifier lowercaseString]; |
|---|
| 268 | | if( [uniqueIdentfier isEqualToString:[_room uniqueIdentifier]] ) |
|---|
| 269 | | return _room; |
|---|
| 270 | | |
|---|
| 271 | | if( ! _knownRooms ) |
|---|
| 272 | | _knownRooms = [[NSMutableDictionary alloc] initWithCapacity:200]; |
|---|
| 273 | | |
|---|
| 274 | | MVChatRoom *room = nil; |
|---|
| 275 | | @synchronized( _knownRooms ) { |
|---|
| 276 | | room = [_knownRooms objectForKey:uniqueIdentfier]; |
|---|
| 277 | | if( room ) |
|---|
| 278 | | return room; |
|---|
| 279 | | |
|---|
| 280 | | room = [[MVICBChatRoom alloc] initWithName:identifier |
|---|
| 281 | | andConnection:self]; |
|---|
| 282 | | if( room ) |
|---|
| 283 | | [_knownRooms setObject:room forKey:uniqueIdentfier]; |
|---|
| 284 | | } |
|---|
| 285 | | |
|---|
| 286 | | return [room autorelease]; |
|---|
| | 267 | MVChatRoom *room; |
|---|
| | 268 | @synchronized( _joinedRooms ) { |
|---|
| | 269 | room = [self joinedChatRoomWithName:identifier]; |
|---|
| | 270 | if( !room ) { |
|---|
| | 271 | room = [[MVICBChatRoom alloc] initWithName:identifier |
|---|
| | 272 | andConnection:self]; |
|---|
| | 273 | [self _addJoinedRoom:room]; |
|---|
| | 274 | } |
|---|
| | 275 | } |
|---|
| | 276 | return room; |
|---|