Show Reject/Accept buttons for offers.

This commit is contained in:
John Preston
2025-11-28 17:28:27 +04:00
parent 6fccbf036c
commit 1e89ee4e50
21 changed files with 796 additions and 354 deletions
@@ -1219,7 +1219,8 @@ bool HistoryMessageReplyMarkup::hiddenBy(Data::Media *media) const {
void HistoryMessageReplyMarkup::updateSuggestControls(
SuggestionActions actions) {
if (actions == SuggestionActions::AcceptAndDecline) {
if (actions == SuggestionActions::AcceptAndDecline
|| actions == SuggestionActions::GiftOfferActions) {
data.flags |= ReplyMarkupFlag::SuggestionAccept;
} else {
data.flags &= ~ReplyMarkupFlag::SuggestionAccept;
@@ -1238,7 +1239,21 @@ void HistoryMessageReplyMarkup::updateSuggestControls(
type,
&HistoryMessageMarkupButton::type);
};
if (actions == SuggestionActions::AcceptAndDecline) {
if (actions == SuggestionActions::GiftOfferActions) {
if (has(Type::SuggestAccept)) {
// Nothing changed.
}
data.rows.push_back({
{
Type::SuggestDecline,
tr::lng_action_gift_offer_decline(tr::now),
},
{
Type::SuggestAccept,
tr::lng_action_gift_offer_accept(tr::now),
},
});
} else if (actions == SuggestionActions::AcceptAndDecline) {
// ... rows ...
// [decline] | [accept]
// [suggestchanges]