Patch from mathuaerknedam to remove outgoing (on top of incoming) for AIContentEvents. Fixes #11588.
2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #import <Adium/AIContentObject.h>
18 #import <Adium/AIContentStatus.h>
20 @implementation AIContentStatus
22 //Create a new status content object
23 + (id)statusInChat:(AIChat *)inChat
24 withSource:(id)inSource
25 destination:(id)inDest
27 message:(NSAttributedString *)inMessage
28 withType:(NSString *)inStatus
30 return [[[self alloc] initWithChat:inChat
35 withType:inStatus] autorelease];
39 - (id)initWithChat:(AIChat *)inChat
41 destination:(id)inDest
43 message:(NSAttributedString *)inMessage
44 withType:(NSString *)inStatus
46 if ((self = [super initWithChat:inChat source:inSource destination:inDest date:inDate message:inMessage])) {
47 //Filter so that triggers in messages can be resolved, don't track status changes
51 //Store source and dest
52 statusType = [inStatus retain];
61 [statusType release]; statusType = nil;
62 [loggedMessage release]; loggedMessage = nil;
63 [coalescingKey release]; coalescingKey = nil;
68 - (NSMutableArray *)displayClasses
70 NSMutableArray *classes = [super displayClasses];
72 //The notion of direction is not very useful on statuses
73 NSUInteger idxin = [classes indexOfObject:@"incoming"];
74 if(idxin != NSNotFound)
75 [classes removeObjectAtIndex:idxin];
77 NSUInteger idxout = [classes indexOfObject:@"outgoing"];
78 if(idxout != NSNotFound)
79 [classes removeObjectAtIndex:idxout];
81 [classes addObject:@"status"];
82 [classes addObject:statusType];
89 return CONTENT_STATUS_TYPE;
92 //The type of status change this is
93 @synthesize status = statusType;
94 @synthesize loggedMessage;
95 @synthesize coalescingKey;