diff options
Diffstat (limited to 'plugins/Scriver/chat')
-rw-r--r-- | plugins/Scriver/chat/chat.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/chat/manager.cpp | 5 | ||||
-rw-r--r-- | plugins/Scriver/chat/services.cpp | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Scriver/chat/chat.h b/plugins/Scriver/chat/chat.h index 1c11ad223a..b8671fdb82 100644 --- a/plugins/Scriver/chat/chat.h +++ b/plugins/Scriver/chat/chat.h @@ -338,7 +338,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);
HWND SM_FindWindowByContact(HANDLE hContact);
USERINFO* SM_AddUser(SESSION_INFO* si, const TCHAR* pszUID, const TCHAR* pszNick, WORD wStatus);
diff --git a/plugins/Scriver/chat/manager.cpp b/plugins/Scriver/chat/manager.cpp index 30bdfc80c7..9573c920fa 100644 --- a/plugins/Scriver/chat/manager.cpp +++ b/plugins/Scriver/chat/manager.cpp @@ -91,7 +91,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;
@@ -130,6 +130,9 @@ int SM_RemoveSession( const TCHAR* pszID, const char* pszModule) DBWriteContactSettingString(pTemp->windowData.hContact, pTemp->pszModule, "StatusBar", "");
DBDeleteContactSetting(pTemp->windowData.hContact, "CList", "StatusMsg");
+ if (removeContact)
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)pTemp->windowData.hContact, 0);
+
mir_free( pTemp->pszModule );
mir_free( pTemp->ptszID );
mir_free( pTemp->ptszName );
diff --git a/plugins/Scriver/chat/services.cpp b/plugins/Scriver/chat/services.cpp index 24aec8e9cc..edda2bf488 100644 --- a/plugins/Scriver/chat/services.cpp +++ b/plugins/Scriver/chat/services.cpp @@ -331,7 +331,7 @@ static INT_PTR 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);
}
|