mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
fix: check if a message is modified
This commit is contained in:
parent
70c3bb3288
commit
4870d59a43
1 changed files with 26 additions and 14 deletions
|
@ -54,10 +54,10 @@ void AddDeletedMessagesActions(PeerData *peerData,
|
||||||
const auto topic = peerData->isForum() ? thread->asTopic() : nullptr;
|
const auto topic = peerData->isForum() ? thread->asTopic() : nullptr;
|
||||||
const auto topicId = topic ? topic->rootId().bare : 0;
|
const auto topicId = topic ? topic->rootId().bare : 0;
|
||||||
|
|
||||||
const auto has = AyuMessages::hasDeletedMessages(peerData, topicId);
|
// const auto has = AyuMessages::hasDeletedMessages(peerData, topicId);
|
||||||
if (!has) {
|
// if (!has) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
addCallback(
|
addCallback(
|
||||||
tr::ayu_ViewDeletedMenuText(tr::now),
|
tr::ayu_ViewDeletedMenuText(tr::now),
|
||||||
|
@ -171,17 +171,29 @@ void AddOpenChannelAction(PeerData *peerData,
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddHistoryAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
|
void AddHistoryAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
|
||||||
if (AyuMessages::hasRevisions(item)) {
|
if (item->hideEditedBadge()) {
|
||||||
menu->addAction(
|
return;
|
||||||
tr::ayu_EditsHistoryMenuText(tr::now),
|
|
||||||
[=]
|
|
||||||
{
|
|
||||||
item->history()->session().tryResolveWindow()
|
|
||||||
->showSection(
|
|
||||||
std::make_shared<MessageHistory::SectionMemento>(item->history()->peer, item, 0));
|
|
||||||
},
|
|
||||||
&st::ayuEditsHistoryIcon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto edited = item->Get<HistoryMessageEdited>();
|
||||||
|
if (!edited) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto has = AyuMessages::hasRevisions(item);
|
||||||
|
if (!has) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
menu->addAction(
|
||||||
|
tr::ayu_EditsHistoryMenuText(tr::now),
|
||||||
|
[=]
|
||||||
|
{
|
||||||
|
item->history()->session().tryResolveWindow()
|
||||||
|
->showSection(
|
||||||
|
std::make_shared<MessageHistory::SectionMemento>(item->history()->peer, item, 0));
|
||||||
|
},
|
||||||
|
&st::ayuEditsHistoryIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddHideMessageAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
|
void AddHideMessageAction(not_null<Ui::PopupMenu*> menu, HistoryItem *item) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue