Skip to content

Commit

Permalink
Show scheduled limit error.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Nov 21, 2024
1 parent e3d9216 commit af78e4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Telegram/Resources/langs/lang.strings
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_error_nocopy_group" = "Sorry, copying from this group is disabled by admins.";
"lng_error_nocopy_channel" = "Sorry, copying from this channel is disabled by admins.";
"lng_error_nocopy_story" = "Sorry, the creator of this story disabled copying.";
"lng_error_schedule_limit" = "Sorry, you can't schedule more than 100 messages.";
"lng_sure_add_admin_invite" = "This user is not a member of this group. Add them to the group and promote them to admin?";
"lng_sure_add_admin_invite_channel" = "This user is not a subscriber of this channel. Add them to the channel and promote them to admin?";
"lng_sure_add_admin_unremove" = "This user is currently restricted or removed. Are you sure you want to promote them?";
Expand Down
8 changes: 8 additions & 0 deletions Telegram/SourceFiles/apiwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,14 @@ void ApiWrap::sendMessageFail(
: tr::lng_error_noforwards_group(tr::now), kJoinErrorDuration);
} else if (error == u"PREMIUM_ACCOUNT_REQUIRED"_q) {
Settings::ShowPremium(&session(), "premium_stickers");
} else if (error == u"SCHEDULE_TOO_MUCH"_q) {
auto &scheduled = _session->scheduledMessages();
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
scheduled.removeSending(item);
}
if (show) {
show->showToast(tr::lng_error_schedule_limit(tr::now));
}
}
if (const auto item = _session->data().message(itemId)) {
Assert(randomId != 0);
Expand Down

0 comments on commit af78e4e

Please sign in to comment.