summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-14 20:42:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-14 20:42:31 +0300
commita76c706113f6d9e1a1a253feab46051fb2e6ce12 (patch)
tree9ca792786b2d95300b6e4d0e61b5fdfb76034f2a
parent0edc6006e17f896324d4011acdf5e16162572908 (diff)
more common data moved into CTabBaseDlg
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp9
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp9
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp4
-rw-r--r--plugins/TabSRMM/src/msgs.cpp10
-rw-r--r--plugins/TabSRMM/src/msgs.h8
5 files changed, 16 insertions, 24 deletions
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp
index 18ae16fec0..a9561d8030 100644
--- a/plugins/TabSRMM/src/chat_window.cpp
+++ b/plugins/TabSRMM/src/chat_window.cpp
@@ -1558,21 +1558,12 @@ void CChatRoomDlg::OnInitDialog()
{
CTabBaseDlg::OnInitDialog();
- m_cache = CContactCache::getContactCache(m_hContact);
- m_cache->updateNick();
- m_cache->updateUIN();
-
m_si->pDlg = this;
- m_bIsAutosizingInput = IsAutoSplitEnabled();
- m_fLimitedUpdate = false;
- m_iInputAreaHeight = -1;
m_iSplitterY = m_pContainer->settings->iSplitterY;
if (m_bIsAutosizingInput)
m_iSplitterY = GetDefaultMinimumInputHeight();
- CProxyWindow::add(this);
-
// Typing support for GCW_PRIVMESS sessions
if (m_si->iType == GCW_PRIVMESS) {
m_nTypeMode = PROTOTYPE_SELFTYPING_OFF;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index bc1b473ccd..d609e39ddd 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -30,7 +30,7 @@
#define MS_HTTPSERVER_ADDFILENAME "HTTPServer/AddFileName"
-bool IsStringValidLink(wchar_t* pszText);
+bool IsStringValidLink(wchar_t *pszText);
static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
static const UINT formatControls[] = { IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTSTRIKEOUT };
@@ -963,18 +963,13 @@ void CSrmmWindow::OnInitDialog()
if (Utils::rtf_ctable == 0)
Utils::RTF_CTableInit();
- m_cache = CContactCache::getContactCache(m_hContact);
- m_cache->updateNick();
m_cache->setWindowData(this);
- //////////////////////////////////////////////////////////////////////////////////////
m_szProto = const_cast<char *>(m_cache->getProto());
m_bIsMeta = m_cache->isMeta();
if (m_bIsMeta)
m_cache->updateMeta();
- m_cache->updateUIN();
-
// show a popup if wanted...
if (m_bWantPopup) {
DBEVENTINFO dbei = {};
@@ -1039,8 +1034,6 @@ void CSrmmWindow::OnInitDialog()
m_pPanel.getVisibility();
m_dwFlagsEx |= M.GetByte(m_hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
- m_bIsAutosizingInput = IsAutoSplitEnabled();
- m_iInputAreaHeight = -1;
SetMessageLog();
if (m_hContact)
m_pPanel.loadHeight();
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 8fd3b87740..56084bbd15 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1267,7 +1267,7 @@ void CTabBaseDlg::GetLocaleID(const wchar_t *szKLName)
}
}
-void CTabBaseDlg::LoadContactAvatar()
+void CSrmmWindow::LoadContactAvatar()
{
m_ace = Utils::loadAvatarFromAVS(m_bIsMeta ? db_mc_getSrmmSub(m_hContact) : m_hContact);
@@ -1290,7 +1290,7 @@ void CTabBaseDlg::LoadContactAvatar()
GetAvatarVisibility();
}
-void CTabBaseDlg::LoadOwnAvatar()
+void CSrmmWindow::LoadOwnAvatar()
{
if (ServiceExists(MS_AV_GETMYAVATAR))
m_ownAce = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)(m_cache->getActiveProto()));
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 2df17da155..b082285657 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -123,7 +123,8 @@ CTabBaseDlg::CTabBaseDlg(int iResource, SESSION_INFO *si)
m_log(this, IDC_LOG),
m_message(this, IDC_MESSAGE),
m_pPanel(this),
- m_dwFlags(MWF_INITMODE)
+ m_dwFlags(MWF_INITMODE),
+ m_iInputAreaHeight(-1)
{
m_pLog = &m_log;
m_pEntry = &m_message;
@@ -166,6 +167,13 @@ void CTabBaseDlg::OnInitDialog()
// set up Windows themes
DM_ThemeChanged();
+
+ // refresh cache data for this contact
+ m_cache = CContactCache::getContactCache(m_hContact);
+ m_cache->updateNick();
+ m_cache->updateUIN();
+
+ m_bIsAutosizingInput = IsAutoSplitEnabled();
}
INT_PTR CTabBaseDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 1f97f52581..16851e8c68 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -254,8 +254,6 @@ protected:
int FireEvent(unsigned int type, unsigned int subType = 0);
void GetSendFormat();
bool IsAutoSplitEnabled() const;
- void LoadContactAvatar();
- void LoadOwnAvatar();
void ResizeIeView();
public:
@@ -300,7 +298,7 @@ public:
BYTE m_bShowTyping;
bool m_bShowAvatar, m_bShowInfoAvatar, m_bShowUIElements;
bool m_bUseOffset;
- bool m_bIsHistory, m_bIsMeta, m_bNotOnList;
+ bool m_bIsHistory, m_bNotOnList;
bool m_bkeyProcessed;
bool m_bEditNotesActive;
bool m_bActualHistory;
@@ -446,6 +444,8 @@ class CSrmmWindow : public CTabBaseDlg
CCtrlButton m_btnOk, m_btnAdd, m_btnQuote, m_btnCancelAdd;
+ void LoadContactAvatar();
+ void LoadOwnAvatar();
void MsgWindowUpdateState(UINT msg);
void ReplayQueue();
@@ -453,7 +453,7 @@ public:
int m_iMultiSplit;
int msgTop, rcLogBottom;
wchar_t *wszInitialText;
- bool m_bActivate, m_bWantPopup;
+ bool m_bActivate, m_bWantPopup, m_bIsMeta;
public:
CSrmmWindow();