-
-
Save 07151129/0d56d79670a277e96ab4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From db357ee265ad5a887aee3f3e576f067819c0985b Mon Sep 17 00:00:00 2001 | |
From: Pb <scandium@me.com> | |
Date: Thu, 6 Aug 2015 13:48:48 +0300 | |
Subject: [PATCH 1/1] status support | |
--- | |
skypeweb4adium.xcodeproj/project.pbxproj | 36 +++++++++++++++++++------------- | |
skypeweb4adium/PurpleSkypeWebAccount.h | 1 + | |
skypeweb4adium/PurpleSkypeWebAccount.m | 25 ++++++++++++++++++++++ | |
skypeweb4adium/PurpleSkypeWebService.m | 13 ++++++++++++ | |
4 files changed, 61 insertions(+), 14 deletions(-) | |
diff --git a/skypeweb4adium.xcodeproj/project.pbxproj b/skypeweb4adium.xcodeproj/project.pbxproj | |
index 241a991..78a53f2 100644 | |
--- a/skypeweb4adium.xcodeproj/project.pbxproj | |
+++ b/skypeweb4adium.xcodeproj/project.pbxproj | |
@@ -7,9 +7,9 @@ | |
objects = { | |
/* Begin PBXBuildFile section */ | |
- CD74DB751AED6E4B00E6E652 /* Adium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB721AED6E4B00E6E652 /* Adium.framework */; }; | |
- CD74DB761AED6E4B00E6E652 /* AdiumLibpurple.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB731AED6E4B00E6E652 /* AdiumLibpurple.framework */; }; | |
- CD74DB771AED6E4B00E6E652 /* AIUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB741AED6E4B00E6E652 /* AIUtilities.framework */; }; | |
+ 2F4D9C111B72ADDF00290F27 /* Adium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F4D9C0E1B72ADDF00290F27 /* Adium.framework */; }; | |
+ 2F4D9C121B72ADDF00290F27 /* AdiumLibpurple.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F4D9C0F1B72ADDF00290F27 /* AdiumLibpurple.framework */; }; | |
+ 2F4D9C131B72ADDF00290F27 /* AIUtilities.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F4D9C101B72ADDF00290F27 /* AIUtilities.framework */; }; | |
CD74DB7E1AED6EA100E6E652 /* libglib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB791AED6EA100E6E652 /* libglib.framework */; }; | |
CD74DB7F1AED6EA100E6E652 /* libgobject.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB7A1AED6EA100E6E652 /* libgobject.framework */; }; | |
CD74DB801AED6EA100E6E652 /* libintl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD74DB7B1AED6EA100E6E652 /* libintl.framework */; }; | |
@@ -31,9 +31,9 @@ | |
/* End PBXBuildFile section */ | |
/* Begin PBXFileReference section */ | |
- CD74DB721AED6E4B00E6E652 /* Adium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Adium.framework; path = "adium/build/Release-Debug/Adium.framework"; sourceTree = "<group>"; }; | |
- CD74DB731AED6E4B00E6E652 /* AdiumLibpurple.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdiumLibpurple.framework; path = "adium/build/Release-Debug/AdiumLibpurple.framework"; sourceTree = "<group>"; }; | |
- CD74DB741AED6E4B00E6E652 /* AIUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AIUtilities.framework; path = "adium/build/Release-Debug/AIUtilities.framework"; sourceTree = "<group>"; }; | |
+ 2F4D9C0E1B72ADDF00290F27 /* Adium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Adium.framework; path = adium/build/Release/Adium.framework; sourceTree = "<group>"; }; | |
+ 2F4D9C0F1B72ADDF00290F27 /* AdiumLibpurple.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdiumLibpurple.framework; path = adium/build/Release/AdiumLibpurple.framework; sourceTree = "<group>"; }; | |
+ 2F4D9C101B72ADDF00290F27 /* AIUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AIUtilities.framework; path = adium/build/Release/AIUtilities.framework; sourceTree = "<group>"; }; | |
CD74DB791AED6EA100E6E652 /* libglib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libglib.framework; path = adium/Frameworks/libglib.framework; sourceTree = "<group>"; }; | |
CD74DB7A1AED6EA100E6E652 /* libgobject.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libgobject.framework; path = adium/Frameworks/libgobject.framework; sourceTree = "<group>"; }; | |
CD74DB7B1AED6EA100E6E652 /* libintl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libintl.framework; path = adium/Frameworks/libintl.framework; sourceTree = "<group>"; }; | |
@@ -72,13 +72,13 @@ | |
files = ( | |
CD7B08D91B5C303300E6E652 /* libz.dylib in Frameworks */, | |
CD74DB871AED706500E6E652 /* Foundation.framework in Frameworks */, | |
- CD74DB751AED6E4B00E6E652 /* Adium.framework in Frameworks */, | |
- CD74DB771AED6E4B00E6E652 /* AIUtilities.framework in Frameworks */, | |
+ 2F4D9C121B72ADDF00290F27 /* AdiumLibpurple.framework in Frameworks */, | |
CD74DB7F1AED6EA100E6E652 /* libgobject.framework in Frameworks */, | |
CD74DB801AED6EA100E6E652 /* libintl.framework in Frameworks */, | |
CD74DB811AED6EA100E6E652 /* libjson-glib.framework in Frameworks */, | |
+ 2F4D9C111B72ADDF00290F27 /* Adium.framework in Frameworks */, | |
+ 2F4D9C131B72ADDF00290F27 /* AIUtilities.framework in Frameworks */, | |
CD74DB821AED6EA100E6E652 /* libpurple.framework in Frameworks */, | |
- CD74DB761AED6E4B00E6E652 /* AdiumLibpurple.framework in Frameworks */, | |
CD74DB7E1AED6EA100E6E652 /* libglib.framework in Frameworks */, | |
); | |
runOnlyForDeploymentPostprocessing = 0; | |
@@ -99,9 +99,9 @@ | |
CD74DB781AED6E5200E6E652 /* Adium */ = { | |
isa = PBXGroup; | |
children = ( | |
- CD74DB721AED6E4B00E6E652 /* Adium.framework */, | |
- CD74DB731AED6E4B00E6E652 /* AdiumLibpurple.framework */, | |
- CD74DB741AED6E4B00E6E652 /* AIUtilities.framework */, | |
+ 2F4D9C0E1B72ADDF00290F27 /* Adium.framework */, | |
+ 2F4D9C0F1B72ADDF00290F27 /* AdiumLibpurple.framework */, | |
+ 2F4D9C101B72ADDF00290F27 /* AIUtilities.framework */, | |
CD74DB791AED6EA100E6E652 /* libglib.framework */, | |
CD74DB7A1AED6EA100E6E652 /* libgobject.framework */, | |
CD74DB7B1AED6EA100E6E652 /* libintl.framework */, | |
@@ -341,7 +341,7 @@ | |
"$(SOURCE_ROOT)/adium/Frameworks/libjson-glib.framework/Versions/Current/Headers", | |
"$(SOURCE_ROOT)/adium/Frameworks/libpurple.framework/Versions/Current/Headers", | |
); | |
- MACOSX_DEPLOYMENT_TARGET = 10.10; | |
+ MACOSX_DEPLOYMENT_TARGET = 10.9; | |
MTL_ENABLE_DEBUG_INFO = YES; | |
OTHER_CFLAGS = "-DPURPLE_STATIC_PRPL"; | |
SDKROOT = macosx10.9; | |
@@ -389,7 +389,7 @@ | |
"$(SOURCE_ROOT)/adium/Frameworks/libjson-glib.framework/Versions/Current/Headers", | |
"$(SOURCE_ROOT)/adium/Frameworks/libpurple.framework/Versions/Current/Headers", | |
); | |
- MACOSX_DEPLOYMENT_TARGET = 10.10; | |
+ MACOSX_DEPLOYMENT_TARGET = 10.9; | |
MTL_ENABLE_DEBUG_INFO = NO; | |
OTHER_CFLAGS = "-DPURPLE_STATIC_PRPL"; | |
SDKROOT = macosx10.9; | |
@@ -400,6 +400,10 @@ | |
isa = XCBuildConfiguration; | |
buildSettings = { | |
COMBINE_HIDPI_IMAGES = YES; | |
+ FRAMEWORK_SEARCH_PATHS = ( | |
+ "$(inherited)", | |
+ "$(PROJECT_DIR)/adium/build/Release", | |
+ ); | |
INFOPLIST_FILE = skypeweb4adium/Info.plist; | |
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; | |
PRODUCT_NAME = "$(TARGET_NAME)"; | |
@@ -412,6 +416,10 @@ | |
isa = XCBuildConfiguration; | |
buildSettings = { | |
COMBINE_HIDPI_IMAGES = YES; | |
+ FRAMEWORK_SEARCH_PATHS = ( | |
+ "$(inherited)", | |
+ "$(PROJECT_DIR)/adium/build/Release", | |
+ ); | |
INFOPLIST_FILE = skypeweb4adium/Info.plist; | |
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; | |
PRODUCT_NAME = "$(TARGET_NAME)"; | |
diff --git a/skypeweb4adium/PurpleSkypeWebAccount.h b/skypeweb4adium/PurpleSkypeWebAccount.h | |
index ae1d46d..2fdc9dc 100644 | |
--- a/skypeweb4adium/PurpleSkypeWebAccount.h | |
+++ b/skypeweb4adium/PurpleSkypeWebAccount.h | |
@@ -8,6 +8,7 @@ | |
#import <Cocoa/Cocoa.h> | |
#import <AdiumLibpurple/CBPurpleAccount.h> | |
+#import <Adium/AIStatus.h> | |
@interface PurpleSkypeWebAccount : CBPurpleAccount | |
diff --git a/skypeweb4adium/PurpleSkypeWebAccount.m b/skypeweb4adium/PurpleSkypeWebAccount.m | |
index de5c2ca..c45d261 100644 | |
--- a/skypeweb4adium/PurpleSkypeWebAccount.m | |
+++ b/skypeweb4adium/PurpleSkypeWebAccount.m | |
@@ -20,4 +20,29 @@ | |
return @"api.skype.com"; | |
} | |
+- (const char *)purpleStatusIDForStatus:(AIStatus *)statusState | |
+ arguments:(NSMutableDictionary *)arguments | |
+{ | |
+ char *statusID = NULL; | |
+ | |
+ switch (statusState.statusType) { | |
+ case AIAvailableStatusType: | |
+ statusID = "Online"; | |
+ break; | |
+ case AIAwayStatusType: | |
+ statusID = "Away"; | |
+ break; | |
+ | |
+ case AIInvisibleStatusType: | |
+ statusID = "Hidden"; | |
+ break; | |
+ | |
+ case AIOfflineStatusType: | |
+ statusID = "Offline"; | |
+ break; | |
+ } | |
+ | |
+ return statusID; | |
+} | |
+ | |
@end | |
diff --git a/skypeweb4adium/PurpleSkypeWebService.m b/skypeweb4adium/PurpleSkypeWebService.m | |
index 5b45f6b..b12b9cc 100644 | |
--- a/skypeweb4adium/PurpleSkypeWebService.m | |
+++ b/skypeweb4adium/PurpleSkypeWebService.m | |
@@ -36,6 +36,19 @@ | |
- (BOOL) caseSensitive { return NO; } | |
- (BOOL) canRegisterNewAccounts { return NO; } | |
+- (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_BUSY, AIAwayStatusType); | |
+ ADDSTATUS(STATUS_NAME_INVISIBLE, AIInvisibleStatusType); | |
+ ADDSTATUS(STATUS_NAME_OFFLINE, AIOfflineStatusType); | |
+} | |
+ | |
- (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType | |
{ | |
if ((iconType == AIServiceIconSmall) || (iconType == AIServiceIconList)) { | |
-- | |
2.3.3 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment