mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-25 21:25:30 +02:00
fix: show notice for unforwardable messages
This commit is contained in:
parent
41523b03d1
commit
28ceb0bed2
2 changed files with 9 additions and 14 deletions
|
@ -3189,17 +3189,17 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
if (_dragStateItem) {
|
if (_dragStateItem) {
|
||||||
const auto view = viewByItem(_dragStateItem);
|
const auto view = viewByItem(_dragStateItem);
|
||||||
const auto textItem = view ? view->textItem() : _dragStateItem;
|
const auto textItem = view ? view->textItem() : _dragStateItem;
|
||||||
/*const auto wasAmount = _menu->actions().size();*/
|
const auto wasAmount = _menu->actions().size();
|
||||||
HistoryView::AddEmojiPacksAction(
|
HistoryView::AddEmojiPacksAction(
|
||||||
_menu,
|
_menu,
|
||||||
textItem ? textItem : _dragStateItem,
|
textItem ? textItem : _dragStateItem,
|
||||||
HistoryView::EmojiPacksSource::Message,
|
HistoryView::EmojiPacksSource::Message,
|
||||||
_controller);
|
_controller);
|
||||||
/*const auto added = (_menu->actions().size() > wasAmount);
|
const auto added = (_menu->actions().size() > wasAmount);
|
||||||
HistoryView::AddSelectRestrictionAction(
|
HistoryView::AddSelectRestrictionAction(
|
||||||
_menu,
|
_menu,
|
||||||
textItem ? textItem : _dragStateItem,
|
textItem ? textItem : _dragStateItem,
|
||||||
!added);*/
|
!added);
|
||||||
}
|
}
|
||||||
if (hasWhoReactedItem) {
|
if (hasWhoReactedItem) {
|
||||||
HistoryView::AddWhoReactedAction(
|
HistoryView::AddWhoReactedAction(
|
||||||
|
|
|
@ -95,6 +95,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
|
#include "ayu/features/forward/ayu_forward.h"
|
||||||
#include "ayu/ui/context_menu/context_menu.h"
|
#include "ayu/ui/context_menu/context_menu.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -1419,7 +1420,7 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
||||||
AddCopyLinkAction(result, link);
|
AddCopyLinkAction(result, link);
|
||||||
AddMessageActions(result, request, list);
|
AddMessageActions(result, request, list);
|
||||||
|
|
||||||
/*const auto wasAmount = result->actions().size();*/
|
const auto wasAmount = result->actions().size();
|
||||||
if (const auto textItem = view ? view->textItem() : item) {
|
if (const auto textItem = view ? view->textItem() : item) {
|
||||||
AddEmojiPacksAction(
|
AddEmojiPacksAction(
|
||||||
result,
|
result,
|
||||||
|
@ -1427,10 +1428,10 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
||||||
HistoryView::EmojiPacksSource::Message,
|
HistoryView::EmojiPacksSource::Message,
|
||||||
list->controller());
|
list->controller());
|
||||||
}
|
}
|
||||||
/*if (item) {
|
if (item) {
|
||||||
const auto added = (result->actions().size() > wasAmount);
|
const auto added = (result->actions().size() > wasAmount);
|
||||||
AddSelectRestrictionAction(result, item, !added);
|
AddSelectRestrictionAction(result, item, !added);
|
||||||
}*/
|
}
|
||||||
if (hasWhoReactedItem) {
|
if (hasWhoReactedItem) {
|
||||||
AddWhoReactedAction(result, list, item, list->controller());
|
AddWhoReactedAction(result, list, item, list->controller());
|
||||||
} else if (item) {
|
} else if (item) {
|
||||||
|
@ -2076,7 +2077,7 @@ void AddSelectRestrictionAction(
|
||||||
not_null<HistoryItem*> item,
|
not_null<HistoryItem*> item,
|
||||||
bool addIcon) {
|
bool addIcon) {
|
||||||
const auto peer = item->history()->peer;
|
const auto peer = item->history()->peer;
|
||||||
if ((peer->allowsForwarding() && !item->forbidsForward())
|
if ((!peer->isAyuNoForwards() && !AyuForward::isAyuForwardNeeded(item))
|
||||||
|| item->isSponsored()) {
|
|| item->isSponsored()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2090,13 +2091,7 @@ void AddSelectRestrictionAction(
|
||||||
addIcon
|
addIcon
|
||||||
? st::historySponsoredAboutMenuLabelPosition
|
? st::historySponsoredAboutMenuLabelPosition
|
||||||
: st::historyHasCustomEmojiPosition,
|
: st::historyHasCustomEmojiPosition,
|
||||||
(peer->isMegagroup()
|
tr::ayu_UnforwardableContextMenuText(
|
||||||
? tr::lng_context_noforwards_info_group
|
|
||||||
: (peer->isChannel())
|
|
||||||
? tr::lng_context_noforwards_info_channel
|
|
||||||
: (peer->isUser() && peer->asUser()->isBot())
|
|
||||||
? tr::lng_context_noforwards_info_channel
|
|
||||||
: tr::lng_context_noforwards_info_bot)(
|
|
||||||
tr::now,
|
tr::now,
|
||||||
Ui::Text::RichLangValue),
|
Ui::Text::RichLangValue),
|
||||||
addIcon ? &st::menuIconCopyright : nullptr);
|
addIcon ? &st::menuIconCopyright : nullptr);
|
||||||
|
|
Loading…
Add table
Reference in a new issue