2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Replaced some qstr with u""_q literal.

This commit is contained in:
23rd
2022-11-27 00:20:17 +03:00
parent 22dc7023fc
commit 2acedca6b7
99 changed files with 477 additions and 480 deletions

View File

@@ -479,12 +479,12 @@ void ApiWrap::sendMessageFail(
FullMsgId itemId) {
const auto show = ShowForPeer(peer);
if (error == qstr("PEER_FLOOD")) {
if (error == u"PEER_FLOOD"_q) {
show->showBox(
Ui::MakeInformBox(
PeerFloodErrorText(&session(), PeerFloodType::Send)),
Ui::LayerOption::CloseOther);
} else if (error == qstr("USER_BANNED_IN_CHANNEL")) {
} else if (error == u"USER_BANNED_IN_CHANNEL"_q) {
const auto link = Ui::Text::Link(
tr::lng_cant_more_info(tr::now),
session().createInternalLinkFull(qsl("spambot")));
@@ -496,8 +496,8 @@ void ApiWrap::sendMessageFail(
link,
Ui::Text::WithEntities)),
Ui::LayerOption::CloseOther);
} else if (error.startsWith(qstr("SLOWMODE_WAIT_"))) {
const auto chop = qstr("SLOWMODE_WAIT_").size();
} else if (error.startsWith(u"SLOWMODE_WAIT_"_q)) {
const auto chop = u"SLOWMODE_WAIT_"_q.size();
const auto left = base::StringViewMid(error, chop).toInt();
if (const auto channel = peer->asChannel()) {
const auto seconds = channel->slowmodeSeconds();
@@ -508,7 +508,7 @@ void ApiWrap::sendMessageFail(
requestFullPeer(peer);
}
}
} else if (error == qstr("SCHEDULE_STATUS_PRIVATE")) {
} else if (error == u"SCHEDULE_STATUS_PRIVATE"_q) {
auto &scheduled = _session->data().scheduledMessages();
Assert(peer->isUser());
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
@@ -517,7 +517,7 @@ void ApiWrap::sendMessageFail(
Ui::MakeInformBox(tr::lng_cant_do_this()),
Ui::LayerOption::CloseOther);
}
} else if (error == qstr("CHAT_FORWARDS_RESTRICTED")) {
} else if (error == u"CHAT_FORWARDS_RESTRICTED"_q) {
if (show->valid()) {
Ui::ShowMultilineToast({
.parentOverride = show->toastParent(),
@@ -528,7 +528,7 @@ void ApiWrap::sendMessageFail(
.duration = kJoinErrorDuration
});
}
} else if (error == qstr("PREMIUM_ACCOUNT_REQUIRED")) {
} else if (error == u"PREMIUM_ACCOUNT_REQUIRED"_q) {
Settings::ShowPremium(&session(), "premium_stickers");
}
if (const auto item = _session->data().message(itemId)) {
@@ -3616,7 +3616,7 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
UnixtimeFromMsgId(response.outerMsgId));
}
}, [=](const MTP::Error &error, const MTP::Response &response) {
if (error.type() == qstr("MESSAGE_EMPTY")) {
if (error.type() == u"MESSAGE_EMPTY"_q) {
lastMessage->destroy();
} else {
sendMessageFail(error, peer, randomId, newId);