mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Moved out credits currency to single place.
This commit is contained in:
parent
d73313479b
commit
e9fb580ba4
3 changed files with 6 additions and 2 deletions
Telegram/SourceFiles
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "smartglocal/smartglocal_token.h"
|
||||
#include "storage/storage_account.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/text/text_entity.h"
|
||||
#include "apiwrap.h"
|
||||
#include "core/core_cloud_password.h"
|
||||
|
@ -385,7 +386,7 @@ void Form::requestForm() {
|
|||
const auto amount = tlPrices.empty()
|
||||
? 0
|
||||
: tlPrices.front().data().vamount().v;
|
||||
if (currency != "XTR" || !amount) {
|
||||
if (currency != ::Ui::kCreditsCurrency || !amount) {
|
||||
using Type = Error::Type;
|
||||
_updates.fire(Error{ Type::Form, u"Bad Stars Form."_q });
|
||||
return;
|
||||
|
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "payments/payments_form.h"
|
||||
#include "history/history_item.h"
|
||||
#include "ui/layers/generic_box.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "boxes/send_credits_box.h"
|
||||
|
||||
|
@ -20,7 +21,7 @@ namespace {
|
|||
bool IsCreditsInvoice(not_null<HistoryItem*> item) {
|
||||
const auto media = item->media();
|
||||
const auto invoice = media ? media->invoice() : nullptr;
|
||||
return invoice && (invoice->currency == "XTR");
|
||||
return invoice && (invoice->currency == Ui::kCreditsCurrency);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -13,6 +13,8 @@ inline constexpr auto FileStatusSizeReady = 0xFFFFFFF0LL;
|
|||
inline constexpr auto FileStatusSizeLoaded = 0xFFFFFFF1LL;
|
||||
inline constexpr auto FileStatusSizeFailed = 0xFFFFFFF2LL;
|
||||
|
||||
inline const QString kCreditsCurrency = u"XTR"_q;
|
||||
|
||||
[[nodiscard]] QString FormatSizeText(qint64 size);
|
||||
[[nodiscard]] QString FormatDownloadText(qint64 ready, qint64 total);
|
||||
[[nodiscard]] QString FormatProgressText(qint64 ready, qint64 total);
|
||||
|
|
Loading…
Add table
Reference in a new issue