Add -[AIService pathForDefaultServiceIconOfType:], and use it for replacing %serviceIconImg% in headers. Fixes #12697.
2 // PurpleFacebookService.m
5 // Created by Evan Schoenberg on 1/15/09.
6 // Copyright 2009 Adium X. All rights reserved.
9 #import "PurpleFacebookService.h"
10 #import "PurpleFacebookAccount.h"
11 #import "PurpleFacebookAccountViewController.h"
12 #import <Adium/AIStatusControllerProtocol.h>
13 #import <AIUtilities/AIImageAdditions.h>
15 @implementation PurpleFacebookService
18 - (Class)accountClass{
19 return [PurpleFacebookAccount class];
22 - (AIAccountViewController *)accountViewController{
23 return [PurpleFacebookAccountViewController accountViewController];
26 - (DCJoinChatViewController *)joinChatView{
31 - (NSString *)serviceCodeUniqueID{
32 return @"facebook-http";
34 - (NSString *)serviceID{
37 - (NSString *)serviceClass{
40 - (NSString *)shortDescription{
43 - (NSString *)longDescription{
46 - (NSCharacterSet *)allowedCharacters{
47 return [[NSCharacterSet illegalCharacterSet] invertedSet];
49 - (NSUInteger)allowedLength{
52 - (AIServiceImportance)serviceImportance{
53 return AIServiceSecondary;
55 - (NSString *)userNameLabel{
56 return AILocalizedString(@"Email", "Used as a label for a username specified by email address");
58 - (NSString *)contactUserNameLabel{
59 return AILocalizedString(@"Facebook Email", "Label for the username for a Facebook contact");
61 - (void)registerStatuses{
62 [adium.statusController registerStatus:STATUS_NAME_AVAILABLE
63 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
64 ofType:AIAvailableStatusType
68 - (BOOL)isSocialNetworkingService
76 * Service Icon packs should always include images for all the built-in Adium services. This method allows external
77 * service plugins to specify an image which will be used when the service icon pack does not specify one. It will
78 * also be useful if new services are added to Adium itself after a significant number of Service Icon packs exist
79 * which do not yet have an image for this service. If the active Service Icon pack provides an image for this service,
80 * this method will not be called.
82 * The service should _not_ cache this icon internally; multiple calls should return unique NSImage objects.
84 * @param iconType The AIServiceIconType of the icon to return. This specifies the desired size of the icon.
85 * @return NSImage to use for this service by default
87 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
89 if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
90 return [NSImage imageNamed:@"facebook-small" forClass:[self class] loadLazily:YES];
92 return [NSImage imageNamed:@"facebook" forClass:[self class] loadLazily:YES];
97 * @brief Path for default icon
99 * For use in message views, this is the path to a default icon as described above.
101 * @param iconType The AIServiceIconType of the icon to return.
102 * @return The path to the image, otherwise nil.
104 - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
106 if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) {
107 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"facebook-small"];
109 return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"facebook"];