2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Track sending and failed messages.

This commit is contained in:
John Preston
2019-07-17 16:34:39 +02:00
parent 0005e0a3ce
commit c50ade565a
19 changed files with 427 additions and 316 deletions

View File

@@ -918,23 +918,6 @@ void MainWidget::removeDialog(Dialogs::Key key) {
_dialogs->removeDialog(key);
}
bool MainWidget::sendMessageFail(const RPCError &error) {
if (MTP::isDefaultHandledError(error)) return false;
if (error.type() == qstr("PEER_FLOOD")) {
Ui::show(Box<InformBox>(PeerFloodErrorText(PeerFloodType::Send)));
return true;
} else if (error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
const auto link = textcmdLink(
Core::App().createInternalLinkFull(qsl("spambot")),
tr::lng_cant_more_info(tr::now));
const auto text = tr::lng_error_public_groups_denied(tr::now, lt_more_info, link);
Ui::show(Box<InformBox>(text));
return true;
}
return false;
}
void MainWidget::cacheBackground() {
if (Window::Theme::Background()->colorForFill()) {
return;