summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/smileys.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-04-23 11:36:27 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-04-23 11:36:27 +0000
commitdd13e3c81400c3607a4f63a501b53b46052035ab (patch)
treeccd0de10427f8a4e09b0b4bbc6c7cdf840711b16 /plugins/SmileyAdd/src/smileys.cpp
parent6db82178f9864a273287fc5d3c8cd979b91d8c18 (diff)
SmileyAdd:
add per protocol global smiley packs support version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@13056 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SmileyAdd/src/smileys.cpp')
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index dc6a0e215f..bd5aa658b1 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -854,6 +854,32 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr
}
}
+void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMString& defaultFile)
+{
+ if (acc == NULL)
+ return;
+
+ const char* packnam = acc;
+ if (strcmp(packnam, "JABBER") == 0)
+ packnam = "JGMail";
+ else if (strstr(packnam, "SIP") != NULL)
+ packnam = "MSN";
+
+ char path[MAX_PATH];
+ mir_snprintf(path, SIZEOF(path), "Smileys\\nova\\%s.msl", packnam);
+
+ CMString paths = A2T_SM(path), patha;
+ pathToAbsolute(paths, patha);
+
+ if (_taccess(patha.c_str(), 0) != 0)
+ paths = defaultFile;
+ CMString displayName(acc);
+ displayName += TranslateT(" global smiley pack");
+ CMString tname("AllProto");
+ tname += A2T_SM(acc);
+ AddCategory(tname, displayName, smcProto, paths);
+}
+
void SmileyCategoryListType::DeleteAccountAsCategory(PROTOACCOUNT *acc)
{
CMString tname(A2T_SM(acc->szModuleName));
@@ -939,9 +965,17 @@ void SmileyCategoryListType::AddAllProtocolsAsCategory(void)
unsigned lpcp = (unsigned)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
if (lpcp == CALLSERVICE_NOTFOUND) lpcp = CP_ACP;
+ PROTOCOLDESCRIPTOR **proto;
+ int protoCount = 0;
+ CallService(MS_PROTO_ENUMPROTOS, (WPARAM)&protoCount, (LPARAM)&proto);
+
+ for (int i = 0; i < protoCount; i++){
+ PROTOCOLDESCRIPTOR* pd = proto[i];
+ if (pd->type == PROTOTYPE_PROTOCOL && pd->cbSize == sizeof(*pd))
+ AddProtoAsCategory(pd->szName, defaultFile);
+ }
- PROTOACCOUNT **accList;
- int protoCount;
+ PROTOACCOUNT **accList;
ProtoEnumAccounts(&protoCount, &accList);
for (int i = 0; i < protoCount; i++)
AddAccountAsCategory(accList[i], defaultFile);