summaryrefslogtreecommitdiff
path: root/protocols/MRA/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-07 16:36:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-07 16:36:19 +0000
commit65da02c676e7a6f232de27f0edefc73ba02dafb9 (patch)
treefbbcf58f8709733e3b8601bb3d8a37acf2524001 /protocols/MRA/src
parent61038ead217a3342a3e98500d30976b301acfee1 (diff)
- server group to be removed when local one is deleted
- unused stuff removed git-svn-id: http://svn.miranda-ng.org/main/trunk@6002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r--protocols/MRA/src/Mra.cpp4
-rw-r--r--protocols/MRA/src/Mra.h2
-rw-r--r--protocols/MRA/src/MraProto.cpp1
-rw-r--r--protocols/MRA/src/MraProto.h1
-rw-r--r--protocols/MRA/src/MraSendCommand.cpp5
-rw-r--r--protocols/MRA/src/Mra_svcs.cpp24
6 files changed, 23 insertions, 14 deletions
diff --git a/protocols/MRA/src/Mra.cpp b/protocols/MRA/src/Mra.cpp
index d0a32f7aa3..ff4cdf4909 100644
--- a/protocols/MRA/src/Mra.cpp
+++ b/protocols/MRA/src/Mra.cpp
@@ -139,8 +139,6 @@ static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
MraAntiSpamLoadBadWordsW();
- LoadModules();
-
InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning, TRUE);
DebugPrintCRLFW(L"OnModulesLoaded - DONE");
@@ -151,8 +149,6 @@ int OnPreShutdown(WPARAM wParam, LPARAM lParam)
{
InterlockedExchange((volatile LONG*)&masMraSettings.dwGlobalPluginRunning, FALSE);
- UnloadModules();
-
MraAntiSpamFreeBadWords();
DebugPrintCRLFW(L"OnPreShutdown - DONE");
diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h
index 18ca7ef94e..538d28d2bc 100644
--- a/protocols/MRA/src/Mra.h
+++ b/protocols/MRA/src/Mra.h
@@ -221,8 +221,6 @@ extern LIST<CMraProto> g_Instances;
extern HANDLE hXStatusAdvancedStatusIcons[];
-INT_PTR LoadModules();
-void UnloadModules();
void InitExtraIcons();
CMStringA MraGetSelfVersionString();
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp
index 67a8eba6d7..8617309fe0 100644
--- a/protocols/MRA/src/MraProto.cpp
+++ b/protocols/MRA/src/MraProto.cpp
@@ -98,6 +98,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMraProto::MraDbSettingChanged);
HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CMraProto::MraRebuildContactMenu);
HookProtoEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged);
+ HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMraProto::OnGroupChanged);
// всех в offline // тк unsaved values сохраняются их нужно инициализировать
for (HANDLE hContact = db_find_first(m_szModuleName); hContact != NULL; hContact = db_find_next(hContact, m_szModuleName))
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h
index 0506eea007..3cbf5bd6b6 100644
--- a/protocols/MRA/src/MraProto.h
+++ b/protocols/MRA/src/MraProto.h
@@ -158,6 +158,7 @@ struct CMraProto : public PROTO<CMraProto>
int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
int __cdecl OnPopupOptInit(WPARAM, LPARAM);
+ int __cdecl OnGroupChanged(WPARAM, LPARAM);
int __cdecl MraChatGcEventHook(WPARAM, LPARAM);
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp
index e2f6f7e008..b95df280ee 100644
--- a/protocols/MRA/src/MraSendCommand.cpp
+++ b/protocols/MRA/src/MraSendCommand.cpp
@@ -219,7 +219,10 @@ DWORD CMraProto::MraModifyContact(HANDLE hContact, DWORD *pdwID, DWORD *pdwConta
CMStringA szEmail, szPhones;
CMStringW wszNick, wszCustomName;
DWORD dwID, dwGroupID, dwContactFlag;
- GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones);
+ if (hContact)
+ GetContactBasicInfoW(hContact, &dwID, &dwGroupID, &dwContactFlag, NULL, NULL, &szEmail, &wszNick, &szPhones);
+ else
+ dwID = dwGroupID = dwContactFlag = 0;
if (pdwID) dwID = *pdwID;
if (pszEmail) szEmail = *pszEmail;
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp
index bcb5a4a65b..aded6d16b4 100644
--- a/protocols/MRA/src/Mra_svcs.cpp
+++ b/protocols/MRA/src/Mra_svcs.cpp
@@ -950,14 +950,24 @@ INT_PTR CMraProto::MraGetMyAvatar(WPARAM wParam, LPARAM lParam)
}
////////////////////////////////////////////////////////////////////////////////////////////////
+// processes clist group removal
-INT_PTR LoadModules(void)
+int CMraProto::OnGroupChanged(WPARAM wParam, LPARAM lParam)
{
- DebugPrintCRLFW(L"MRA/LoadModules - DONE");
+ HANDLE hContact = (HANDLE)wParam;
+ if (hContact == NULL) {
+ CLISTGROUPCHANGE *cgc = (CLISTGROUPCHANGE*)lParam;
+ if (cgc->pszOldName != NULL && cgc->pszNewName == NULL) {
+ for (int i=0; i < m_groups.getCount(); i++) {
+ MraGroupItem &p = m_groups[i];
+ if ( _tcscmp(p.m_name, cgc->pszOldName))
+ continue;
+
+ CMStringA szName = p.m_name;
+ DWORD dwFlags = CONTACT_FLAG_GROUP | CONTACT_FLAG_REMOVED;
+ MraModifyContact(NULL, &p.m_id, &dwFlags, 0, &szName, &p.m_name);
+ }
+ }
+ }
return 0;
}
-
-void UnloadModules()
-{
- DebugPrintCRLFW(L"MRA/UnloadModules - DONE");
-}