summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Chat/chat.h2
-rw-r--r--plugins/Chat/manager.cpp5
-rw-r--r--plugins/Chat/services.cpp2
-rw-r--r--plugins/Scriver/chat/chat.h2
-rw-r--r--plugins/Scriver/chat/manager.cpp5
-rw-r--r--plugins/Scriver/chat/services.cpp2
-rw-r--r--plugins/TabSRMM/chat/chatprototypes.h2
-rw-r--r--plugins/TabSRMM/chat/manager.cpp5
-rw-r--r--plugins/TabSRMM/chat/services.cpp2
9 files changed, 18 insertions, 9 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);
}
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);
}
diff --git a/plugins/TabSRMM/chat/chatprototypes.h b/plugins/TabSRMM/chat/chatprototypes.h
index 066a25e919..06efc299d3 100644
--- a/plugins/TabSRMM/chat/chatprototypes.h
+++ b/plugins/TabSRMM/chat/chatprototypes.h
@@ -76,7 +76,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);
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const TCHAR* pszOriginal, const TCHAR* pszCurrent);
diff --git a/plugins/TabSRMM/chat/manager.cpp b/plugins/TabSRMM/chat/manager.cpp
index 8a1e404ea5..d1c2a27aa3 100644
--- a/plugins/TabSRMM/chat/manager.cpp
+++ b/plugins/TabSRMM/chat/manager.cpp
@@ -98,7 +98,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;
@@ -135,6 +135,9 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule)
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);
mir_free(pTemp->ptszID);
mir_free(pTemp->ptszName);
diff --git a/plugins/TabSRMM/chat/services.cpp b/plugins/TabSRMM/chat/services.cpp
index a8f40a4dec..7f256f3d30 100644
--- a/plugins/TabSRMM/chat/services.cpp
+++ b/plugins/TabSRMM/chat/services.cpp
@@ -349,7 +349,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);
}