From efc8291dafe68435480bb5dd378cf26ee62d042f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Nov 2024 17:24:43 +0300 Subject: =?UTF-8?q?fixes=20#4641=20(Telegram:=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=20=D1=87=D1=83=D0=B6=D0=B8=D1=85=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=BF=D1=87=D0=B0=D1=82=D0=B0,=20=D0=B5=D1=81=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=20=D0=9C=D0=B8=D1=80=D0=B0=D0=BD=D0=B4=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BC=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80/=D0=B2=D0=BB=D0=B0=D0=B4=D0=B5=D0=BB=D0=B5=D1=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'plugins/NewStory') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index b10e7a98a3..d3ee3d07b1 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -347,7 +347,7 @@ class CDeleteEventsDlg : public CDlgBase public: bool bDelHistory = false, bForEveryone = false; - CDeleteEventsDlg(MCONTACT hContact, int nEvents) : + CDeleteEventsDlg(MCONTACT hContact, int nEvents, bool bIncoming) : CDlgBase(g_plugin, IDD_EMPTYHISTORY), m_hContact(hContact), m_iNumEvents(nEvents), @@ -355,7 +355,7 @@ public: chkForEveryone(this, IDC_BOTH) { if (char *szProto = Proto_GetBaseAccountName(hContact)) { - bDelHistory = Proto_CanDeleteHistory(szProto, hContact); + bDelHistory = Proto_CanDeleteHistory(szProto, hContact, bIncoming); bForEveryone = (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, hContact) & PF4_DELETEFORALL) != 0; } } @@ -406,11 +406,18 @@ public: void NewstoryListData::DeleteItems(void) { int nSelected = 0; - for (int i = totalCount - 1; i >= 0; i--) - if (GetItem(i)->m_bSelected) + bool bIncoming = false; + + for (int i = totalCount - 1; i >= 0; i--) { + auto *pItem = GetItem(i); + if (pItem->m_bSelected) { + if ((pItem->dbe.flags & DBEF_SENT) == 0) + bIncoming = true; nSelected++; + } + } - CDeleteEventsDlg dlg(m_hContact, nSelected); + CDeleteEventsDlg dlg(m_hContact, nSelected, bIncoming); if (IDOK == dlg.DoModal()) { g_plugin.bDisableDelete = true; -- cgit v1.2.3