diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index b145afa5f..f6af33095 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -188,7 +188,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_settings_show_preview" = "Show message preview"; "lng_settings_use_windows" = "Use Windows notifications"; "lng_settings_sound_notify" = "Play sound"; -"lng_settings_include_muted" = "Include muted chats in the unread badge"; +"lng_settings_include_muted" = "Include muted chats in unread count"; "lng_notification_preview" = "You have a new message"; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index cb1abf4df..4b736c5f5 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -674,7 +674,7 @@ void Application::checkMapVersion() { if (Local::oldMapVersion()) { QString versionFeatures; if (cDevVersion() && Local::oldMapVersion() < 8053) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 Include muted chats in the unread badge setting\n\xe2\x80\x94 Shared links overview and search in shared media");// .replace('@', qsl("@") + QChar(0x200D)); + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Include muted chats in unread count in Settings\n\xe2\x80\x94 Shared links overview and search in shared media");// .replace('@', qsl("@") + QChar(0x200D)); } else if (!cDevVersion() && Local::oldMapVersion() < 8052) { versionFeatures = lang(lng_new_version_minor).trimmed(); } diff --git a/Telegram/SourceFiles/gui/text.cpp b/Telegram/SourceFiles/gui/text.cpp index ef42afe58..78c6f2523 100644 --- a/Telegram/SourceFiles/gui/text.cpp +++ b/Telegram/SourceFiles/gui/text.cpp @@ -554,15 +554,16 @@ public: start = src.constData(); end = start + src.size(); - while (start != end && chIsTrimmed(*start, rich)) { - ++start; + ptr = start; + while (ptr != end && chIsTrimmed(*ptr, rich)) { + ++ptr; } - while (start != end && chIsTrimmed(*(end - 1), rich)) { + while (ptr != end && chIsTrimmed(*(end - 1), rich)) { --end; } _t->_text.resize(0); - _t->_text.reserve(end - start); + _t->_text.reserve(end - ptr); diacs = 0; sumWidth = 0; @@ -575,7 +576,7 @@ public: lastSpace = true; waitingLink = lnkRanges.cbegin(); linksEnd = lnkRanges.cend(); - for (ptr = start; ptr <= end; ++ptr) { + for (; ptr <= end; ++ptr) { if (!checkWaitedLink()) { break; } diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 81ed01580..4e30f83c0 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -1002,7 +1002,7 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl App::historyRegSentText(randomId, sendingText); MTPstring msgText(MTP_string(sendingText)); - int32 flags = newMessageFlags(hist->peer); // unread, out + int32 flags = newMessageFlags(hist->peer) | MTPDmessage::flag_entities; // unread, out int32 sendFlags = 0; if (replyTo) { flags |= MTPDmessage::flag_reply_to_msg_id; @@ -1016,7 +1016,7 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl media = MTP_messageMediaWebPage(MTP_webPagePending(MTP_long(page->id), MTP_int(page->pendingTill))); } MTPVector localEntities = linksToMTP(textParseLinks(sendingText, itemTextParseOptions(hist, App::self()).flags)); - hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, MTPnullEntities)); + hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities)); hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), App::main()->rpcDone(&MainWidget::sentDataReceived, randomId), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); } @@ -1744,11 +1744,12 @@ void MainWidget::dialogsCancelled() { } void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia &media, bool unread) { - int32 flags = unread ? MTPDmessage_flag_unread : 0; + int32 flags = (unread ? MTPDmessage_flag_unread : 0) | MTPDmessage::flag_entities; QString sendingText, leftText = msg; HistoryItem *item = 0; while (textSplit(sendingText, leftText, MaxMessageSize)) { - item = App::histories().addToBack(MTP_message(MTP_int(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPint(), MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, MTPnullEntities), unread ? 1 : 2); + MTPVector localEntities = linksToMTP(textParseLinks(sendingText, _historyTextOptions.flags)); + item = App::histories().addToBack(MTP_message(MTP_int(flags), MTP_int(clientMsgId()), MTP_int(ServiceUserId), MTP_peerUser(MTP_int(MTP::authedId())), MTPint(), MTPint(), MTPint(), MTP_int(unixtime()), MTP_string(sendingText), media, MTPnullMarkup, localEntities), unread ? 1 : 2); } if (item) { history.peerMessagesUpdated(item->history()->peer->id);