diff options
author | George Hazan <ghazan@miranda.im> | 2022-07-16 21:23:06 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-07-16 21:23:06 +0300 |
commit | cd4272ca22d47cdf673bfb0e5ec353acca3d9569 (patch) | |
tree | 0e2a4879766d8197cdf8a8fb6d5f5033399a0ea4 /plugins/SendScreenshotPlus/src | |
parent | d6a052756f58211067a7a67d7e3c1dbe7e6c9465 (diff) |
Contact_IsGroupChat - a helper to detect chat rooms
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSend.cpp | 2 | ||||
-rw-r--r-- | plugins/SendScreenshotPlus/src/Main.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp index db1056c748..385f413d06 100644 --- a/plugins/SendScreenshotPlus/src/CSend.cpp +++ b/plugins/SendScreenshotPlus/src/CSend.cpp @@ -66,7 +66,7 @@ void CSend::SetContact(MCONTACT hContact) m_hContact = hContact; if (hContact) { m_pszProto = Proto_GetBaseAccountName(hContact); - m_ChatRoom = db_get_b(hContact, m_pszProto, "ChatRoom", 0); + m_ChatRoom = Contact_IsGroupChat(hContact, m_pszProto); } } diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index 1db150cf55..4233d5e3e6 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -138,14 +138,13 @@ INT_PTR service_SendDesktop(WPARAM wParam, LPARAM) delete frmMain; return -1; } + MCONTACT hContact = (MCONTACT)wParam; - char *pszProto = Proto_GetBaseAccountName(hContact); - bool bChatRoom = db_get_b(hContact, pszProto, "ChatRoom", 0) != 0; frmMain->m_opt_chkTimed = false; frmMain->m_opt_tabCapture = 1; frmMain->m_opt_cboxDesktop = 0; frmMain->m_opt_chkEditor = false; - frmMain->m_opt_cboxSendBy = bChatRoom ? SS_IMAGESHACK : SS_FILESEND; + frmMain->m_opt_cboxSendBy = Contact_IsGroupChat(hContact) ? SS_IMAGESHACK : SS_FILESEND; frmMain->Init(pszPath, hContact); // this method create the window hidden. mir_free(pszPath); frmMain->btnCaptureClick(); // this method will call Close() |