William Bowling is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

wbowling / adium (fork of adium / adium)

Fork of Adium for patches/improvements

Clone this repository (size: 338.7 MB): HTTPS / SSH
hg clone https://bitbucket.org/wbowling/adium
hg clone ssh://hg@bitbucket.org/wbowling/adium

adium / Source / AITwitterIMPlugin.m

//
//  AITwitterIMPlugin.m
//  Adium
//
//  Created by Colin Barrett on 5/14/08.

#import "AITwitterIMPlugin.h"
#import <Adium/AIListObject.h>
#import <Adium/AIService.h>

@implementation AITwitterIMPlugin

- (void)installPlugin
{
        [[AIContactObserverManager sharedManager] registerListObjectObserver:self];
}

- (void)dealloc
{
        [[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
        [super dealloc];
}

- (NSSet *)updateListObject:(AIListObject *)inObject keys:(NSSet *)inModifiedKeys silent:(BOOL)silent
{
        NSSet *returnSet = nil;
        
        if (!inModifiedKeys) {
                if (([inObject.UID isEqualToString:@"twitter@twitter.com"] &&
                         [inObject.service.serviceClass isEqualToString:@"Jabber"]) ||
                        ([inObject.service.serviceClass isEqualToString:@"Twitter"] || 
                         [inObject.service.serviceClass isEqualToString:@"Laconica"])) {
                        
                        if (![inObject valueForProperty:@"Character Counter Max"]) {
                                [inObject setValue:[NSNumber numberWithInteger:140] forProperty:@"Character Counter Max" notify:YES];
                                returnSet = [NSSet setWithObjects:@"Character Counter Max", nil];
                        }
                }
        }
        
        return returnSet;
}

@end