adium: General fixes in preparation for release
[siplcs.git] / src / adium / ESSIPEService.m
blobc4d0a6610b46b78ffa2ed1b3654bbb6885d077b2
1 //
2 //  ESSIPEService.m
3 //  SIPEAdiumPlugin
4 //
5 //  Created by Matt Meissner on 10/30/09.
6 //  Modified by Michael Lamb on 2/27/13
7 //  Copyright 2013 Michael Lamb/Harris Kauffman. All rights reserved.
8 //
10 #import <AIUtilities/AICharacterSetAdditions.h>
11 #import <AIUtilities/AIImageAdditions.h>
12 #import <Adium/AIStatusControllerProtocol.h>
13 #import <AISharedAdium.h>
15 #import "ESSIPEAccountViewController.h"
16 #import "ESPurpleSIPEAccount.h"
17 #import "ESSIPEService.h"
19 @implementation ESSIPEService
21 #pragma mark Account/Chat Creation
22 - (Class)accountClass
24         return [ESPurpleSIPEAccount class];
27 - (AIAccountViewController *)accountViewController{
28     return [ESSIPEAccountViewController accountViewController];
31 - (DCJoinChatViewController *)joinChatView{
32         return nil;
35 #pragma mark Service Description Metadata
36 - (NSString *)serviceCodeUniqueID{
37     return @"libpurple-SIPE";
40 - (NSString *)serviceID{
41     return @"SIPE";
44 - (NSString *)serviceClass{
45         return @"SIPE";
48 - (NSString *)shortDescription{
49     return @"OCS";
52 - (NSString *)longDescription{
53     return @"Office Communicator";
56 - (BOOL)caseSensitive{
57         return NO;
59 - (AIServiceImportance)serviceImportance{
60         return AIServiceSecondary;
62 - (BOOL)canCreateGroupChats{
63         return NO;
66 // Some auth schemes may not need a password
67 - (BOOL)requiresPassword{
68         return NO;
71 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType {
72         NSImage *baseImage = [NSImage imageNamed:@"sipe" forClass:[self class]];
73     
74         if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) { 
75         [baseImage setSize:NSMakeSize(16, 16)];
76         }
77     
78         return baseImage;
82 #pragma mark Service Properties
83 - (NSCharacterSet *)allowedCharacters
85         NSMutableCharacterSet *allowedCharacters = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
86         NSCharacterSet *returnSet;
87         
88         [allowedCharacters addCharactersInString:@"._@-()[]^%#|/\\`=,"];
89         returnSet = [allowedCharacters immutableCopy];
90         
91         return [returnSet autorelease];
94 #pragma mark Statuses
95 - (void)registerStatuses{
96     
97     
98         [adium.statusController registerStatus:STATUS_NAME_AVAILABLE
99                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
100                                     ofType:AIAvailableStatusType
101                                 forService:self];
102         
103         [adium.statusController registerStatus:STATUS_NAME_AWAY
104                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY]
105                                     ofType:AIAwayStatusType
106                                 forService:self];
107         
108         [adium.statusController registerStatus:STATUS_NAME_BUSY
109                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_BUSY]
110                                     ofType:AIAwayStatusType
111                                 forService:self];
112     
113         [adium.statusController registerStatus:STATUS_NAME_INVISIBLE
114                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_INVISIBLE]
115                                     ofType:AIInvisibleStatusType
116                                 forService:self];
117     
118     [adium.statusController registerStatus:STATUS_NAME_BRB
119                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_BRB]
120                                     ofType:AIAwayStatusType
121                                 forService:self];
122     
123     [adium.statusController registerStatus:STATUS_NAME_DND
124                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_DND]
125                                     ofType:AIAwayStatusType
126                                 forService:self];
127     
128     [adium.statusController registerStatus:STATUS_NAME_LUNCH
129                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_LUNCH]
130                                     ofType:AIAwayStatusType
131                                 forService:self];
132     
133     [adium.statusController registerStatus:STATUS_NAME_OFFLINE
134                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_OFFLINE]
135                                     ofType:AIOfflineStatusType
136                                 forService:self];
137     
138     [adium.statusController registerStatus:STATUS_NAME_PHONE
139                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_PHONE]
140                                     ofType:AIAwayStatusType
141                                 forService:self];
142     
143     [adium.statusController registerStatus:STATUS_NAME_NOT_AT_DESK
144                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_NOT_AT_DESK]
145                                     ofType:AIAwayStatusType
146                                 forService:self];
147     
148     [adium.statusController registerStatus:STATUS_NAME_NOT_IN_OFFICE
149                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_NOT_IN_OFFICE]
150                                     ofType:AIAwayStatusType
151                                 forService:self];
152     
153     [adium.statusController registerStatus:STATUS_NAME_AWAY_FRIENDS_ONLY
154                            withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY_FRIENDS_ONLY]
155                                     ofType:AIAwayStatusType
156                                 forService:self];
160 @end