Skip to content

Commit

Permalink
Plugin is now working...
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Igumnov committed May 22, 2018
1 parent 535dae6 commit e24d06d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
17 changes: 6 additions & 11 deletions slack4adium/PurpleSlackAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,33 @@ @implementation PurpleSlackAccount

- (const char*)protocolPlugin
{
return "prpl-slackweb";
return "prpl-slack";
}

- (NSString *)host
{
return @"slack.com";
}

/*

- (const char *)purpleStatusIDForStatus:(AIStatus *)statusState
arguments:(NSMutableDictionary *)arguments
{
char *statusID = NULL;

switch (statusState.statusType) {
case AIAvailableStatusType:
statusID = "Online";
statusID = "active";
break;
case AIAwayStatusType:
statusID = "Away";
break;
case AIInvisibleStatusType:
statusID = "Hidden";
statusID = "away";
break;
case AIOfflineStatusType:
statusID = "Offline";
statusID = "offline";
break;
}

return statusID;
}*/
}

@end
23 changes: 10 additions & 13 deletions slack4adium/PurpleSlackService.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (NSString *) serviceCodeUniqueID { return @"libpurple-slackweb"; }
- (NSString *) serviceID { return @"Slack"; }
- (NSString *) serviceClass { return @"Slack"; }
- (NSString *) shortDescription { return @"Slack"; }
- (NSString *) longDescription { return @"Slack Web API"; }
- (NSString *) longDescription { return @"Slack API"; }
- (NSUInteger) allowedLength { return 64; }
- (BOOL) requiresPassword { return YES; }
- (BOOL) supportsPassword { return YES; }
Expand All @@ -52,18 +52,15 @@ - (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType
return [[NSBundle bundleForClass:[self class]] pathForImageResource:@"slack48"];
}

- (void)registerStatus:(NSString*) status_name ofType:(AIStatusType) status_type
{
[adium.statusController registerStatus:status_name
withDescription:[adium.statusController localizedDescriptionForCoreStatusName:status_name]
ofType:status_type forService:self];
}

- (void)registerStatuses {
[self registerStatus: STATUS_NAME_AVAILABLE ofType:AIAvailableStatusType];
[self registerStatus: STATUS_NAME_AWAY ofType:AIAwayStatusType];
[self registerStatus: STATUS_NAME_BUSY ofType:AIAwayStatusType];
[self registerStatus: STATUS_NAME_OFFLINE ofType:AIOfflineStatusType];
- (void) registerStatuses {
#define ADDSTATUS(name, type) \
[adium.statusController registerStatus:name \
withDescription:[adium.statusController localizedDescriptionForCoreStatusName:name] \
ofType:type forService:self]

ADDSTATUS(STATUS_NAME_AVAILABLE, AIAvailableStatusType);
ADDSTATUS(STATUS_NAME_AWAY, AIAwayStatusType);
ADDSTATUS(STATUS_NAME_OFFLINE, AIOfflineStatusType);
}

@end

0 comments on commit e24d06d

Please sign in to comment.