| | 62 | // Parse sourceUIDs of the form "username instance", produced by libpurple in group chats (classes) |
|---|
| | 63 | // It seems this function never gets called for a non-group chat, but we check for a space to be safe |
|---|
| | 64 | - (AIListContact *)contactWithUID:(NSString *)sourceUID |
|---|
| | 65 | { |
|---|
| | 66 | NSRange firstSpace = [sourceUID rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@" "]]; |
|---|
| | 67 | if (firstSpace.location == NSNotFound) |
|---|
| | 68 | return [super contactWithUID:sourceUID]; // it's a non-group sourceUID |
|---|
| | 69 | |
|---|
| | 70 | NSString *username = [sourceUID substringToIndex:firstSpace.location]; |
|---|
| | 71 | AIListContact *contact = [super contactWithUID:username]; |
|---|
| | 72 | NSString *contactWithInstance = [NSString stringWithFormat:@"%@ / %@", |
|---|
| | 73 | [contact displayName], |
|---|
| | 74 | [[sourceUID substringFromIndex:(firstSpace.location+1)] lowercaseString]]; |
|---|
| | 75 | return [[adium contactController] contactWithService:service account:self UID:contactWithInstance]; |
|---|
| | 76 | } |
|---|
| | 77 | |
|---|