summaryrefslogtreecommitdiff
path: root/plugins/Chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-27 08:05:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-27 08:05:12 +0000
commit248b320bc7e6ce0cfd6621d47a95b55e2264dd23 (patch)
tree5735f77b447dc0c1f41b9f1960dd4751cc6a0f83 /plugins/Chat
parent939b54967dcda681318271d203eedd1dcf5ce934 (diff)
sync
git-svn-id: http://svn.miranda-ng.org/main/trunk@646 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Chat')
-rw-r--r--plugins/Chat/chat.h2
-rw-r--r--plugins/Chat/manager.cpp5
-rw-r--r--plugins/Chat/services.cpp2
3 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Chat/chat.h b/plugins/Chat/chat.h
index b30f741da2..f8130358aa 100644
--- a/plugins/Chat/chat.h
+++ b/plugins/Chat/chat.h
@@ -447,7 +447,7 @@ void SetActiveSession(const TCHAR* pszID, const char* pszModule);
void SetActiveSessionEx(SESSION_INFO* si);
SESSION_INFO* GetActiveSession(void);
SESSION_INFO* SM_AddSession(const TCHAR* pszID, const char* pszModule);
-int SM_RemoveSession(const TCHAR* pszID, const char* pszModule);
+int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, BOOL removeContact);
SESSION_INFO* SM_FindSession(const TCHAR* pszID, const char* pszModule);
USERINFO* SM_AddUser(const TCHAR* pszID, const char* pszModule, const TCHAR* pszUID, const TCHAR* pszNick, WORD wStatus);
BOOL SM_ChangeUID(const TCHAR* pszID, const char* pszModule, const TCHAR* pszUID, const TCHAR* pszNewUID);
diff --git a/plugins/Chat/manager.cpp b/plugins/Chat/manager.cpp
index 1b9ecd9421..02a0f76a59 100644
--- a/plugins/Chat/manager.cpp
+++ b/plugins/Chat/manager.cpp
@@ -87,7 +87,7 @@ SESSION_INFO* SM_AddSession( const TCHAR* pszID, const char* pszModule)
return NULL;
}
-int SM_RemoveSession( const TCHAR* pszID, const char* pszModule)
+int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, BOOL removeContact)
{
SESSION_INFO *pTemp = m_WndList, *pLast = NULL;
@@ -138,6 +138,9 @@ int SM_RemoveSession( const TCHAR* pszID, const char* pszModule)
DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule, "Topic", "");
DBWriteContactSettingString(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
DBDeleteContactSetting(pTemp->hContact, "CList", "StatusMsg");
+
+ if (removeContact)
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)pTemp->hContact, 0);
}
mir_free( pTemp->pszModule );
diff --git a/plugins/Chat/services.cpp b/plugins/Chat/services.cpp
index 6f305cc906..06e4f20cc8 100644
--- a/plugins/Chat/services.cpp
+++ b/plugins/Chat/services.cpp
@@ -501,7 +501,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
break;
}
case SESSION_TERMINATE:
- return SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ return SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule, (gce->dwFlags & GCEF_REMOVECONTACT) != 0);
}
SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_EVENT_CONTROL + WM_USER + 500, wp, 0);
}