| 52 | } |
| 53 | |
| 54 | String * AddressDisplay::veryShortDisplayStringForAddress(Address * address) |
| 55 | { |
| 56 | if ((address->displayName() != NULL) && (address->displayName()->length() > 0)) { |
| 57 | Array * components; |
| 58 | String * senderName; |
| 59 | |
| 60 | senderName = sanitizeDisplayName(address->displayName()); |
| 61 | senderName = (String *) senderName->copy()->autorelease(); |
| 62 | |
| 63 | senderName->replaceOccurrencesOfString(MCSTR(","), MCSTR(" ")); |
| 64 | senderName->replaceOccurrencesOfString(MCSTR("'"), MCSTR(" ")); |
| 65 | senderName->replaceOccurrencesOfString(MCSTR("\""), MCSTR(" ")); |
| 66 | components = senderName->componentsSeparatedByString(MCSTR(" ")); |
| 67 | if (components->count() == 0) { |
| 68 | return MCLOCALIZEDSTRING(MCSTR("invalid")); |
| 69 | } |
| 70 | return (String *) components->objectAtIndex(0); |
| 71 | } |
| 72 | else if (address->mailbox()) { |
| 73 | Array * components = address->mailbox()->componentsSeparatedByString(MCSTR("@")); |
| 74 | if (components->count() == 0) { |
| 75 | return MCSTR(""); |
| 76 | } |
| 77 | return (String *) components->objectAtIndex(0); |
| 78 | } |
| 79 | else { |
| 80 | return MCLOCALIZEDSTRING(MCSTR("invalid")); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | String * AddressDisplay::displayStringForAddresses(Array * addresses) |
| 85 | { |
nothing calls this directly
no test coverage detected