summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-01 14:49:06 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-01 14:49:06 +0300
commit53221d7d7853d463f5703c8b1d95447f501c834d (patch)
tree74554b127c79143b8c361f3d77cc7707c054b08c /plugins
parentc5866000711953d0b970c6fe649dab811ba00e4b (diff)
tabSRMM: time to get rid of the second CMsgDialog constructor
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp34
-rw-r--r--plugins/TabSRMM/src/msgs.cpp2
-rw-r--r--plugins/TabSRMM/src/msgs.h1
3 files changed, 11 insertions, 26 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index b76cb19c9d..f21c2431ce 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -330,35 +330,21 @@ CMsgDialog::CMsgDialog(int iDlgId, MCONTACT hContact) :
{
m_hContact = hContact;
- m_btnAdd.OnClick = Callback(this, &CMsgDialog::onClick_Add);
m_btnQuote.OnClick = Callback(this, &CMsgDialog::onClick_Quote);
- m_btnCancelAdd.OnClick = Callback(this, &CMsgDialog::onClick_CancelAdd);
- Init();
-}
-
-CMsgDialog::CMsgDialog(SESSION_INFO *si) :
- CSuper(g_plugin, IDD_CHANNEL, si),
- m_pPanel(this),
- timerAwayMsg(this, 100),
- m_btnAdd(this, IDC_ADD),
- m_btnQuote(this, IDC_QUOTE),
- m_btnCancelAdd(this, IDC_CANCELADD),
- m_btnStrikeout(this, IDC_FONTSTRIKEOUT)
-{
- m_hContact = si->hContact;
-
- m_btnQuote.OnClick = Callback(this, &CMsgDialog::onClick_Quote);
- m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
- m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowNickList);
+ if (Contact::IsGroupChat(hContact)) {
+ m_si = Chat_Find(hContact);
- m_nickList.OnDblClick = Callback(this, &CMsgDialog::onDblClick_List);
+ m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
+ m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowNickList);
- Init();
-}
+ m_nickList.OnDblClick = Callback(this, &CMsgDialog::onDblClick_List);
+ }
+ else {
+ m_btnAdd.OnClick = Callback(this, &CMsgDialog::onClick_Add);
+ m_btnCancelAdd.OnClick = Callback(this, &CMsgDialog::onClick_CancelAdd);
+ }
-void CMsgDialog::Init()
-{
GetSendFormat();
m_szProto = Proto_GetBaseAccountName(m_hContact);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 359fcf67ad..25b2e9c06a 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -320,7 +320,7 @@ CMsgDialog* TSAPI CreateNewTabForContact(
CMsgDialog *pWindow;
if (Contact::IsGroupChat(hContact))
- pWindow = new CMsgDialog(Chat_Find(hContact, szProto));
+ pWindow = new CMsgDialog(IDD_CHANNEL, hContact);
else
pWindow = new CMsgDialog(IDD_MSGSPLITNEW, hContact);
pWindow->m_iTabID = iTabId;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index f713b470b8..d5519a0637 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -420,7 +420,6 @@ class CMsgDialog : public CSrmmBaseDialog
void GetSendFormat(void);
HICON GetXStatusIcon() const;
void HandlePasteAndSend(void);
- void Init(void);
void LoadContactAvatar(void);
void LoadOwnAvatar(void);
void LoadSplitter(void);