diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-25 16:44:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-25 16:44:33 +0000 |
commit | 27035a4a46167dc714b770c77561f14e8d0b945d (patch) | |
tree | b67bbf56d590118aeae36bd187966666983f8631 /src/modules/protocols | |
parent | a30011d4b7881cc9e55077ddd6b9686ce54c3343 (diff) |
draft version of the dynamic accounts' removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@1655 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols')
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 3fd5aeee6b..65ad1e3de7 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -452,28 +452,27 @@ BOOL ActivateAccount(PROTOACCOUNT* pa) CreateProtoServiceEx(pa->szModuleName, PS_GETNAME, (MIRANDASERVICEOBJ)stub41, pa->ppro);
CreateProtoServiceEx(pa->szModuleName, PS_GETSTATUS, (MIRANDASERVICEOBJ)stub42, pa->ppro);
+ char szServiceName[ 200 ];
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETAVATARINFO);
+ if ( !ServiceExists(szServiceName)) {
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETAVATARINFOW);
+ if (ServiceExists(szServiceName))
+ CreateProtoServiceEx(pa->szModuleName, PS_GETAVATARINFO, (MIRANDASERVICEOBJ)stub43, pa->ppro);
+ }
- char szServiceName[ 200 ];
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETAVATARINFO);
- if ( !ServiceExists(szServiceName)) {
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETAVATARINFOW);
- if (ServiceExists(szServiceName))
- CreateProtoServiceEx(pa->szModuleName, PS_GETAVATARINFO, (MIRANDASERVICEOBJ)stub43, pa->ppro);
- }
-
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETMYAVATAR);
- if ( !ServiceExists(szServiceName)) {
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETMYAVATARW);
- if (ServiceExists(szServiceName))
- CreateProtoServiceEx(pa->szModuleName, PS_GETMYAVATAR, (MIRANDASERVICEOBJ)stub44, pa->ppro);
- }
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETMYAVATAR);
+ if ( !ServiceExists(szServiceName)) {
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_GETMYAVATARW);
+ if (ServiceExists(szServiceName))
+ CreateProtoServiceEx(pa->szModuleName, PS_GETMYAVATAR, (MIRANDASERVICEOBJ)stub44, pa->ppro);
+ }
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_SETMYAVATAR);
- if ( !ServiceExists(szServiceName)) {
- mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_SETMYAVATARW);
- if (ServiceExists(szServiceName))
- CreateProtoServiceEx(pa->szModuleName, PS_SETMYAVATAR, (MIRANDASERVICEOBJ)stub45, pa->ppro);
- }
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_SETMYAVATAR);
+ if ( !ServiceExists(szServiceName)) {
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%s", pa->szModuleName, PS_SETMYAVATARW);
+ if (ServiceExists(szServiceName))
+ CreateProtoServiceEx(pa->szModuleName, PS_SETMYAVATAR, (MIRANDASERVICEOBJ)stub45, pa->ppro);
+ }
return TRUE;
}
@@ -615,6 +614,15 @@ void UnloadAccountsModule() /////////////////////////////////////////////////////////////////////////////////////////
+void KillProtoAccounts(const char *szProtoName)
+{
+ for (int i=0; i < accounts.getCount(); i++)
+ if ( !strcmp(szProtoName, accounts[i]->szProtoName))
+ DeactivateAccount(accounts[i], true, false);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void BuildProtoMenus()
{
for (int i=0; i < accounts.getCount(); i++) {
|