Plugins/Purple Service/ESYahooService.m
branchadium-1.5.11-merge
changeset 6013 f8d0dc659e3f
parent 5941 307f53385811
parent 6012 200a01709ba4
child 6014 fcb71cb71a3d
child 6015 2b01cc935b7c
equal deleted inserted replaced
5941:307f53385811 6013:f8d0dc659e3f
     1 /* 
       
     2  * Adium is the legal property of its developers, whose names are listed in the copyright file included
       
     3  * with this source distribution.
       
     4  * 
       
     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.
       
     8  * 
       
     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.
       
    12  * 
       
    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.
       
    15  */
       
    16 
       
    17 #import <Adium/AIStatusControllerProtocol.h>
       
    18 #import "DCPurpleYahooJoinChatViewController.h"
       
    19 #import "ESPurpleYahooAccount.h"
       
    20 #import "ESPurpleYahooAccountViewController.h"
       
    21 #import "ESYahooService.h"
       
    22 
       
    23 @implementation ESYahooService
       
    24 
       
    25 //Account Creation
       
    26 - (Class)accountClass{
       
    27 	return [ESPurpleYahooAccount class];
       
    28 }
       
    29 
       
    30 - (AIAccountViewController *)accountViewController{
       
    31     return [ESPurpleYahooAccountViewController accountViewController];
       
    32 }
       
    33 
       
    34 - (DCJoinChatViewController *)joinChatView{
       
    35 	return [DCPurpleYahooJoinChatViewController joinChatView];
       
    36 }
       
    37 
       
    38 - (BOOL)canCreateGroupChats{
       
    39 	return YES;
       
    40 }
       
    41 
       
    42 //Service Description
       
    43 - (NSString *)serviceCodeUniqueID{
       
    44 	return @"libpurple-Yahoo!";
       
    45 }
       
    46 - (NSString *)serviceID{
       
    47 	return @"Yahoo!";
       
    48 }
       
    49 - (NSString *)serviceClass{
       
    50 	return @"Yahoo!";
       
    51 }
       
    52 - (NSString *)shortDescription{
       
    53 	return @"Yahoo!";
       
    54 }
       
    55 - (NSString *)longDescription{
       
    56 	return @"Yahoo! Messenger";
       
    57 }
       
    58 - (NSCharacterSet *)allowedCharacters{
       
    59 	return [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyz0123456789_@.- +"];
       
    60 }
       
    61 - (NSUInteger)allowedLength{
       
    62 	return 50;
       
    63 }
       
    64 - (BOOL)caseSensitive{
       
    65 	return NO;
       
    66 }
       
    67 - (AIServiceImportance)serviceImportance{
       
    68 	return AIServicePrimary;
       
    69 }
       
    70 - (NSString *)userNameLabel{
       
    71     return AILocalizedString(@"Yahoo! ID",nil);    //Yahoo! ID
       
    72 }
       
    73 - (void)registerStatuses{
       
    74 	[adium.statusController registerStatus:STATUS_NAME_AVAILABLE
       
    75 							 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
       
    76 									  ofType:AIAvailableStatusType
       
    77 								  forService:self];
       
    78 	
       
    79 	[adium.statusController registerStatus:STATUS_NAME_AWAY
       
    80 							 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY]
       
    81 									  ofType:AIAwayStatusType
       
    82 								  forService:self];
       
    83 
       
    84 	[adium.statusController registerStatus:STATUS_NAME_INVISIBLE
       
    85 							 withDescription:[adium.statusController localizedDescriptionForCoreStatusName:STATUS_NAME_INVISIBLE]
       
    86 									  ofType:AIInvisibleStatusType
       
    87 								  forService:self];
       
    88 	
       
    89 	/* Yahoo supports custom statuses... ESPurpleYahooAccount will convert a properly written cusutom status
       
    90 	 * into the Yahoo-specific statuses as necessary. Uncomment to explicitly add support for these statuses. */
       
    91 	/*
       
    92 	[adium.statusController registerStatus:STATUS_NAME_BRB
       
    93 							 withDescription:STATUS_DESCRIPTION_BRB
       
    94 									  ofType:AIAwayStatusType
       
    95 								  forService:self];
       
    96 	
       
    97 	[adium.statusController registerStatus:STATUS_NAME_BUSY
       
    98 							 withDescription:STATUS_DESCRIPTION_BUSY
       
    99 									  ofType:AIAwayStatusType
       
   100 								  forService:self];
       
   101 
       
   102 	[adium.statusController registerStatus:STATUS_NAME_NOT_AT_HOME
       
   103 							 withDescription:STATUS_DESCRIPTION_NOT_AT_HOME
       
   104 									  ofType:AIAwayStatusType
       
   105 								  forService:self];
       
   106 
       
   107 	[adium.statusController registerStatus:STATUS_NAME_NOT_AT_DESK
       
   108 							 withDescription:STATUS_DESCRIPTION_NOT_AT_DESK
       
   109 									  ofType:AIAwayStatusType
       
   110 								  forService:self];
       
   111 	
       
   112 	[adium.statusController registerStatus:STATUS_NAME_NOT_IN_OFFICE
       
   113 							 withDescription:STATUS_DESCRIPTION_NOT_IN_OFFICE
       
   114 									  ofType:AIAwayStatusType
       
   115 								  forService:self];
       
   116 	
       
   117 	[adium.statusController registerStatus:STATUS_NAME_PHONE
       
   118 							 withDescription:STATUS_DESCRIPTION_PHONE
       
   119 									  ofType:AIAwayStatusType
       
   120 								  forService:self];
       
   121 	
       
   122 	[adium.statusController registerStatus:STATUS_NAME_VACATION
       
   123 							 withDescription:STATUS_DESCRIPTION_VACATION
       
   124 									  ofType:AIAwayStatusType
       
   125 								  forService:self];
       
   126 
       
   127 	[adium.statusController registerStatus:STATUS_NAME_LUNCH
       
   128 							 withDescription:STATUS_DESCRIPTION_LUNCH
       
   129 									  ofType:AIAwayStatusType
       
   130 								  forService:self];
       
   131 
       
   132 	[adium.statusController registerStatus:STATUS_NAME_STEPPED_OUT
       
   133 							 withDescription:STATUS_DESCRIPTION_STEPPED_OUT
       
   134 									  ofType:AIAwayStatusType
       
   135 								  forService:self];
       
   136 	 */
       
   137 	
       
   138 	/*
       
   139 	m = g_list_append(m, _("Be Right Back"));
       
   140 	m = g_list_append(m, _("Busy"));
       
   141 	m = g_list_append(m, _("Not At Home"));
       
   142 	m = g_list_append(m, _("Not At Desk"));
       
   143 	m = g_list_append(m, _("Not In Office"));
       
   144 	m = g_list_append(m, _("On The Phone"));
       
   145 	m = g_list_append(m, _("On Vacation"));
       
   146 	m = g_list_append(m, _("Out To Lunch"));
       
   147 	m = g_list_append(m, _("Stepped Out"));
       
   148 	 */
       
   149 }
       
   150 
       
   151 @end