// // PurpAccount.m // Purple // // Created by Julian Cain on 2/16/10. // Copyright 2010 __MyCompanyName__. All rights reserved. // #import "PurpAccount.h" @implementation PurpAccount @synthesize username = _username; @synthesize password = _password; - (id)initWithUsername:(NSString *)aUsername password:(NSString *)aPassword protocol:(const char *)aProtocol { if (self = [super init]) { self.username = aUsername; self.password = aPassword; _account = purple_account_new([self.username UTF8String], aProtocol); purple_account_set_password( _account, [self.password UTF8String] ); return self; } return nil; } - (void)setEnabled:(BOOL)flag { /** * Enable or disable the account. */ purple_account_set_enabled(_account, "Proteus", flag); } - (void)setUseSSL:(BOOL)flag { purple_account_set_bool(_account, "use_ssl", flag); purple_account_set_bool(_account, "ssl", flag); } - (void)dealloc { [_username release], _username = 0; [_password release], _password = 0; purple_account_destroy(_account); [super dealloc]; } @end