summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-09 20:11:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-09 20:11:07 +0300
commitdd914976e8eb566403056c8566941a391813868f (patch)
treebdebcba7d6c56a483db7900f230a57815b8382b8
parentb7718450b0856447bb7098f73d674fbd54c16e2d (diff)
fix for incorrect log window drawing
-rw-r--r--include/m_chat_int.h1
-rw-r--r--src/mir_app/src/srmm_base.cpp11
2 files changed, 5 insertions, 7 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h
index d72bff1b0f..94939f412c 100644
--- a/include/m_chat_int.h
+++ b/include/m_chat_int.h
@@ -142,6 +142,7 @@ struct MIR_APP_EXPORT GCSessionInfoBase : public MZeroedObject, public MNonCopya
bool bInitDone;
bool bHasToolTip;
bool bTrimmed;
+ bool bHistoryInit;
char* pszModule;
wchar_t* ptszID;
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index 1a83d7aa86..10bb17736a 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -638,13 +638,11 @@ void CSrmmBaseDialog::RedrawLog()
void CSrmmBaseDialog::UpdateChatLog()
{
- if (!m_si->pMI->bDatabase)
+ if (!m_si->pMI->bDatabase || m_si->bHistoryInit)
return;
GetFirstEvent();
- SESSION_INFO *tmp = g_chatApi.SM_CreateSession();
-
auto *szProto = Proto_GetBaseAccountName(m_hContact);
for (MEVENT hDbEvent = m_hDbEventFirst; hDbEvent; hDbEvent = db_event_next(m_hContact, hDbEvent)) {
DB::EventInfo dbei;
@@ -666,14 +664,13 @@ void CSrmmBaseDialog::UpdateChatLog()
gce.time = dbei.timestamp;
if (USERINFO *ui = g_chatApi.UM_FindUser(m_si, wszUserId))
gce.pszNick.w = ui->pszNick;
- SM_AddEvent(tmp, &gce, false);
+ SM_AddEvent(m_si, &gce, false);
}
}
}
- m_pLog->LogEvents(tmp->pLogEnd, false);
- g_chatApi.LM_RemoveAll(&tmp->pLog, &tmp->pLogEnd);
- delete tmp;
+ m_si->bHistoryInit = true;
+ m_pLog->LogEvents(m_si->pLogEnd, false);
}
/////////////////////////////////////////////////////////////////////////////////////////