diff options
author | George Hazan <george.hazan@gmail.com> | 2013-05-17 19:23:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-05-17 19:23:37 +0000 |
commit | 1d9fd398b75a5a6eca9d40db2e2abb60c96ebc7d (patch) | |
tree | 8d216553e534f6f34be4374741709aba73fc1739 /src | |
parent | c2914d5759e0ba8a3b9a81c8a1f071dba90094b4 (diff) |
some more fixes for MS_DB_CONTACT_DELETE & loops
git-svn-id: http://svn.miranda-ng.org/main/trunk@4710 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdchat/src/manager.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp index 5dead6fe83..ac718a9452 100644 --- a/src/core/stdchat/src/manager.cpp +++ b/src/core/stdchat/src/manager.cpp @@ -134,8 +134,6 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, BOOL removeConta if (pTemp->hContact && db_get_b( pTemp->hContact, pTemp->pszModule, "ChatRoom", 0 ) != 0)
{
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM?TRUE:FALSE);
-/* if (pTemp->iType != GCW_SERVER)
- db_set_b(pTemp->hContact, "CList", "Hidden", 1);*/
db_set_s(pTemp->hContact, pTemp->pszModule, "Topic", "");
db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
db_unset(pTemp->hContact, "CList", "StatusMsg");
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 9ab769b65a..e25dcad0d3 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -143,10 +143,14 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0);
- if (caps & PF1_SERVERCLIST)
- for (HANDLE hContact = db_find_first(ack->szModule); hContact; hContact = db_find_next(hContact, ack->szModule))
+ if (caps & PF1_SERVERCLIST) {
+ for (HANDLE hContact = db_find_first(ack->szModule); hContact; ) {
+ HANDLE hNext = db_find_next(hContact, ack->szModule);
if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ hContact = hNext;
+ }
+ }
}
cli.pfnTrayIconUpdateBase(ack->szModule);
@@ -544,8 +548,7 @@ void UnloadContactListModule() return;
//remove transitory contacts
- HANDLE hContact = db_find_first();
- while (hContact != NULL) {
+ for (HANDLE hContact = db_find_first(); hContact != NULL; ) {
HANDLE hNext = db_find_next(hContact);
if (db_get_b(hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
|