summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/stdchat/src/manager.cpp2
-rw-r--r--src/modules/clist/clistmod.cpp11
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);