diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Scriver/src/chat_main.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 38 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 6 |
5 files changed, 17 insertions, 37 deletions
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index cee6777e6b..4f8757da27 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -117,7 +117,7 @@ static void ShowRoom(SESSION_INFO *si) // Do we need to create a window?
CMsgDialog *pDlg;
if (si->pDlg == nullptr) {
- pDlg = new CMsgDialog(si);
+ pDlg = new CMsgDialog(si->hContact, false);
pDlg->Show();
si->pDlg = pDlg;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 5fbaf8855d..4e991a9477 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -62,7 +62,7 @@ static INT_PTR CALLBACK ConfirmSendAllDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa /////////////////////////////////////////////////////////////////////////////////////////
CMsgDialog::CMsgDialog(MCONTACT hContact, bool bIncoming) :
- CSuper(g_plugin, IDD_MSG),
+ CSuper(g_plugin, IDD_MSG, hContact),
m_bIncoming(bIncoming),
m_splitterX(this, IDC_SPLITTERX),
m_splitterY(this, IDC_SPLITTERY),
@@ -72,36 +72,20 @@ CMsgDialog::CMsgDialog(MCONTACT hContact, bool bIncoming) : m_btnDetails(this, IDC_DETAILS),
m_btnUserMenu(this, IDC_USERMENU)
{
- m_hContact = hContact;
-
- m_btnAdd.OnClick = Callback(this, &CMsgDialog::onClick_Add);
m_btnQuote.OnClick = Callback(this, &CMsgDialog::onClick_Quote);
- m_btnDetails.OnClick = Callback(this, &CMsgDialog::onClick_Details);
- m_btnUserMenu.OnClick = Callback(this, &CMsgDialog::onClick_UserMenu);
-
- Init();
-}
-
-CMsgDialog::CMsgDialog(SESSION_INFO *si) :
- CSuper(g_plugin, IDD_MSG, si),
- m_splitterX(this, IDC_SPLITTERX),
- m_splitterY(this, IDC_SPLITTERY),
-
- m_btnAdd(this, IDC_ADD),
- m_btnQuote(this, IDC_QUOTE),
- m_btnDetails(this, IDC_DETAILS),
- m_btnUserMenu(this, IDC_USERMENU)
-{
- m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
- m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowList);
- m_splitterX.OnChange = Callback(this, &CMsgDialog::onChange_SplitterX);
+ if (isChat()) {
+ m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
+ m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowList);
- Init();
-}
+ m_splitterX.OnChange = Callback(this, &CMsgDialog::onChange_SplitterX);
+ }
+ else {
+ m_btnAdd.OnClick = Callback(this, &CMsgDialog::onClick_Add);
+ m_btnDetails.OnClick = Callback(this, &CMsgDialog::onClick_Details);
+ m_btnUserMenu.OnClick = Callback(this, &CMsgDialog::onClick_UserMenu);
+ }
-void CMsgDialog::Init()
-{
m_autoClose = CLOSE_ON_CANCEL;
m_szProto = Proto_GetBaseAccountName(m_hContact);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index c404105eb3..d1eab61301 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -156,7 +156,7 @@ static INT_PTR SendMessageCommandWorker(MCONTACT hContact, wchar_t *pszMsg) pDlg->PopupWindow();
}
else {
- pDlg = new CMsgDialog(hContact, false);
+ pDlg = new CMsgDialog(hContact, true);
pDlg->m_wszInitialText = pszMsg;
pDlg->Show();
}
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 3a71949364..0cf7a9ad6a 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -51,7 +51,6 @@ class CMsgDialog : public CSrmmBaseDialog void ClearLog(void);
HICON GetTabIcon(void);
void GetTitlebarIcon(struct TitleBarData *tbd);
- void Init(void);
int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void MessageDialogResize(int w, int h);
void MessageSend(const SendQueue::Item &msg);
@@ -68,7 +67,7 @@ class CMsgDialog : public CSrmmBaseDialog static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
- bool m_bIncoming, m_bWindowCascaded;
+ bool m_bIncoming = false, m_bWindowCascaded;
MEVENT m_hDbUnreadEventFirst;
int m_minLogBoxHeight, m_minEditBoxHeight;
@@ -105,8 +104,7 @@ class CMsgDialog : public CSrmmBaseDialog CSplitter m_splitterX, m_splitterY;
public:
- CMsgDialog(MCONTACT hContact, bool bIncoming);
- CMsgDialog(SESSION_INFO *);
+ CMsgDialog(MCONTACT hContact, bool);
bool OnInitDialog() override;
void OnDestroy() override;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index d510320768..d158902e32 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -320,7 +320,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM /////////////////////////////////////////////////////////////////////////////////////////
CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) :
- CSuper(g_plugin, iDlgId),
+ CSuper(g_plugin, iDlgId, hContact),
m_pPanel(this),
timerAwayMsg(this, 100),
m_btnAdd(this, IDC_ADD),
@@ -332,9 +332,7 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) : m_btnQuote.OnClick = Callback(this, &CMsgDialog::onClick_Quote);
- if (Contact::IsGroupChat(hContact)) {
- m_si = Chat_Find(hContact);
-
+ if (m_si) {
m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowNickList);
|