diff options
author | George Hazan <george.hazan@gmail.com> | 2024-11-14 17:24:43 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-11-14 17:24:43 +0300 |
commit | efc8291dafe68435480bb5dd378cf26ee62d042f (patch) | |
tree | e8242a4090dd360c0fae964759237c93017966c5 /plugins/NewStory/src/history_control.cpp | |
parent | e76a4df48aa890a0e466c10f8bf6c40438ffb92a (diff) |
fixes #4641 (Telegram: удаление с сервера чужих сообщений групчата, если пользователь Миранды не модератор/владелец)
Diffstat (limited to 'plugins/NewStory/src/history_control.cpp')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
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;
|