| | 44 | #pragma mark Event descriptions |
|---|
| | 45 | |
|---|
| | 46 | - (NSString *)shortDescriptionForEventID:(NSString *)eventID |
|---|
| | 47 | { |
|---|
| | 48 | NSString *description; |
|---|
| | 49 | |
|---|
| | 50 | if ([eventID isEqualToString:CONTACT_REQUESTED_AUTHORIZATION]) { |
|---|
| | 51 | description = AILocalizedString(@"Requests authorization",nil); |
|---|
| | 52 | } else { |
|---|
| | 53 | description = @""; |
|---|
| | 54 | } |
|---|
| | 55 | |
|---|
| | 56 | return description; |
|---|
| | 57 | } |
|---|
| | 58 | |
|---|
| | 59 | - (NSString *)globalShortDescriptionForEventID:(NSString *)eventID |
|---|
| | 60 | { |
|---|
| | 61 | NSString *description; |
|---|
| | 62 | |
|---|
| | 63 | if ([eventID isEqualToString:CONTACT_REQUESTED_AUTHORIZATION]) { |
|---|
| | 64 | description = AILocalizedString(@"Contact requests authorization",nil); |
|---|
| | 65 | } else { |
|---|
| | 66 | description = @""; |
|---|
| | 67 | } |
|---|
| | 68 | |
|---|
| | 69 | return description; |
|---|
| | 70 | } |
|---|
| | 71 | |
|---|
| | 72 | //Evan: This exists because old X(tras) relied upon matching the description of event IDs, and I don't feel like making |
|---|
| | 73 | //a converter for old packs. If anyone wants to fix this situation, please feel free :) |
|---|
| | 74 | - (NSString *)englishGlobalShortDescriptionForEventID:(NSString *)eventID |
|---|
| | 75 | { |
|---|
| | 76 | NSString *description; |
|---|
| | 77 | |
|---|
| | 78 | if ([eventID isEqualToString:CONTACT_REQUESTED_AUTHORIZATION]) { |
|---|
| | 79 | description = @"Authorization Requested"; |
|---|
| | 80 | } else { |
|---|
| | 81 | description = @""; |
|---|
| | 82 | } |
|---|
| | 83 | |
|---|
| | 84 | return description; |
|---|
| | 85 | } |
|---|
| | 86 | |
|---|
| | 87 | - (NSString *)longDescriptionForEventID:(NSString *)eventID forListObject:(AIListObject *)listObject |
|---|
| | 88 | { |
|---|
| | 89 | NSString *description = nil; |
|---|
| | 90 | |
|---|
| | 91 | if (listObject) { |
|---|
| | 92 | NSString *name; |
|---|
| | 93 | NSString *format; |
|---|
| | 94 | |
|---|
| | 95 | if ([eventID isEqualToString:CONTACT_REQUESTED_AUTHORIZATION]) { |
|---|
| | 96 | format = AILocalizedString(@"When %@ requests authorization",nil); |
|---|
| | 97 | } else { |
|---|
| | 98 | format = nil; |
|---|
| | 99 | } |
|---|
| | 100 | |
|---|
| | 101 | if (format) { |
|---|
| | 102 | name = ([listObject isKindOfClass:[AIListGroup class]] ? |
|---|
| | 103 | [NSString stringWithFormat:AILocalizedString(@"a member of %@",nil),[listObject displayName]] : |
|---|
| | 104 | [listObject displayName]); |
|---|
| | 105 | |
|---|
| | 106 | description = [NSString stringWithFormat:format, name]; |
|---|
| | 107 | } |
|---|
| | 108 | |
|---|
| | 109 | } else { |
|---|
| | 110 | if ([eventID isEqualToString:CONTACT_REQUESTED_AUTHORIZATION]) { |
|---|
| | 111 | description = AILocalizedString(@"When a contact requests authorization",nil); |
|---|
| | 112 | } |
|---|
| | 113 | } |
|---|
| | 114 | |
|---|
| | 115 | return description; |
|---|
| | 116 | } |
|---|
| | 117 | |
|---|
| | 118 | - (NSString *)naturalLanguageDescriptionForEventID:(NSString *)eventID |
|---|
| | 119 | listObject:(AIListObject *)listObject |
|---|
| | 120 | userInfo:(id)userInfo |
|---|
| | 121 | includeSubject:(BOOL)includeSubject |
|---|
| | 122 | { |
|---|
| | 123 | NSString *description = nil; |
|---|
| | 124 | |
|---|
| | 125 | if (includeSubject) { |
|---|
| | 126 | description = [NSString stringWithFormat:AILocalizedString(@"%@ requested authorization", "Event: <A contact's name> requested authorization"), [listObject formattedUID]]; |
|---|
| | 127 | |
|---|
| | 128 | } else { |
|---|
| | 129 | description = AILocalizedString(@"requested authorization", "Event: requested authorization (follows a contact's name displayed as a header)"); |
|---|
| | 130 | } |
|---|
| | 131 | |
|---|
| | 132 | return description; |
|---|
| | 133 | } |
|---|
| | 134 | |
|---|
| | 135 | - (NSImage *)imageForEventID:(NSString *)eventID |
|---|
| | 136 | { |
|---|
| | 137 | static NSImage *eventImage = nil; |
|---|
| | 138 | if (!eventImage) eventImage = [[NSImage imageNamed:@"DefaultIcon" forClass:[self class]] retain]; |
|---|
| | 139 | return eventImage; |
|---|
| | 140 | } |
|---|
| | 141 | |
|---|