mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed unused refund api support for credits.
This commit is contained in:
parent
9e3e7265d2
commit
5db2821f8c
3 changed files with 0 additions and 53 deletions
|
@ -199,24 +199,4 @@ rpl::producer<not_null<PeerData*>> PremiumPeerBot(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreditsRefund(
|
|
||||||
not_null<PeerData*> peer,
|
|
||||||
const QString &entryId,
|
|
||||||
Fn<void()> done,
|
|
||||||
Fn<void(QString)> fail) {
|
|
||||||
const auto user = peer->asUser();
|
|
||||||
if (!user) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
peer->session().api().request(MTPpayments_RefundStarsCharge(
|
|
||||||
user->inputUser,
|
|
||||||
MTP_string(entryId)
|
|
||||||
)).done([=](const MTPUpdates &result) {
|
|
||||||
peer->session().api().updates().applyUpdates(result);
|
|
||||||
done();
|
|
||||||
}).fail([=](const MTP::Error &error) {
|
|
||||||
fail(error.type());
|
|
||||||
}).send();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Api
|
} // namespace Api
|
||||||
|
|
|
@ -68,12 +68,6 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void CreditsRefund(
|
|
||||||
not_null<PeerData*> peer,
|
|
||||||
const QString &entryId,
|
|
||||||
Fn<void()> done,
|
|
||||||
Fn<void(QString)> fail);
|
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<not_null<PeerData*>> PremiumPeerBot(
|
[[nodiscard]] rpl::producer<not_null<PeerData*>> PremiumPeerBot(
|
||||||
not_null<Main::Session*> session);
|
not_null<Main::Session*> session);
|
||||||
|
|
||||||
|
|
|
@ -861,10 +861,6 @@ public:
|
||||||
void rowClicked(not_null<PeerListRow*> row) override;
|
void rowClicked(not_null<PeerListRow*> row) override;
|
||||||
void loadMoreRows() override;
|
void loadMoreRows() override;
|
||||||
|
|
||||||
base::unique_qptr<Ui::PopupMenu> rowContextMenu(
|
|
||||||
QWidget *parent,
|
|
||||||
not_null<PeerListRow*> row) override;
|
|
||||||
|
|
||||||
[[nodiscard]] bool skipRequest() const;
|
[[nodiscard]] bool skipRequest() const;
|
||||||
void requestNext();
|
void requestNext();
|
||||||
|
|
||||||
|
@ -957,29 +953,6 @@ void CreditsController::rowClicked(not_null<PeerListRow*> row) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base::unique_qptr<Ui::PopupMenu> CreditsController::rowContextMenu(
|
|
||||||
QWidget *parent,
|
|
||||||
not_null<PeerListRow*> row) {
|
|
||||||
const auto entry = static_cast<const CreditsRow*>(row.get())->entry();
|
|
||||||
if (!entry.bareId) {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
auto menu = base::make_unique_q<Ui::PopupMenu>(
|
|
||||||
parent,
|
|
||||||
st::defaultPopupMenu);
|
|
||||||
const auto peer = row->peer();
|
|
||||||
const auto callback = crl::guard(parent, [=, id = entry.id] {
|
|
||||||
const auto show = delegate()->peerListUiShow();
|
|
||||||
Api::CreditsRefund(
|
|
||||||
peer,
|
|
||||||
id,
|
|
||||||
[=] { show->showToast(tr::lng_report_spam_done(tr::now)); },
|
|
||||||
[=](const QString &error) { show->showToast(error); });
|
|
||||||
});
|
|
||||||
menu->addAction(tr::lng_channel_earn_history_return(tr::now), callback);
|
|
||||||
return menu;
|
|
||||||
}
|
|
||||||
|
|
||||||
rpl::producer<bool> CreditsController::allLoadedValue() const {
|
rpl::producer<bool> CreditsController::allLoadedValue() const {
|
||||||
return _allLoaded.value();
|
return _allLoaded.value();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue