diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 8f308319b..d742da923 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -83,9 +83,6 @@ constexpr auto kReloadChannelMembersTimeout = 1000; // Save draft to the cloud with 1 sec extra delay. constexpr auto kSaveCloudDraftTimeout = 1000; -// Give the app 1.5 secs to save drafts to cloud when quitting. -constexpr auto kSaveDraftBeforeQuitTimeout = 1500; - // Max users in one super group invite request. constexpr auto kMaxUsersPerInvite = 100; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 018fefc2e..61a0b95cb 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -74,8 +74,6 @@ using CornersMap = QMap; CornersMap cornersMap; QImage cornersMaskLarge[4], cornersMaskSmall[4]; -int32 serviceImageCacheSize = 0; - } // namespace namespace App { diff --git a/Telegram/SourceFiles/boxes/auto_download_box.cpp b/Telegram/SourceFiles/boxes/auto_download_box.cpp index ad16367d5..036513a32 100644 --- a/Telegram/SourceFiles/boxes/auto_download_box.cpp +++ b/Telegram/SourceFiles/boxes/auto_download_box.cpp @@ -97,9 +97,6 @@ void AutoDownloadBox::setupContent() { setTitle(tr::lng_profile_settings_section()); const auto settings = &_session->settings().autoDownload(); - const auto checked = [=](Source source, Type type) { - return (settings->bytesLimit(source, type) > 0); - }; auto wrap = object_ptr(this); const auto content = wrap.data(); diff --git a/Telegram/SourceFiles/boxes/background_preview_box.cpp b/Telegram/SourceFiles/boxes/background_preview_box.cpp index afffec247..6597fe75a 100644 --- a/Telegram/SourceFiles/boxes/background_preview_box.cpp +++ b/Telegram/SourceFiles/boxes/background_preview_box.cpp @@ -348,7 +348,6 @@ QImage ColorizePattern(QImage image, QColor color) { const auto height = image.height(); const auto pattern = anim::shifted(color); - const auto resultBytesPerPixel = (image.depth() >> 3); constexpr auto resultIntsPerPixel = 1; const auto resultIntsPerLine = (image.bytesPerLine() >> 2); const auto resultIntsAdded = resultIntsPerLine - width * resultIntsPerPixel; @@ -744,7 +743,6 @@ void BackgroundPreviewBox::checkLoadedDocument() { guard = _generating.make_guard() ]() mutable { auto scaled = PrepareScaledFromFull(image, patternBackground); - const auto ms = crl::now(); auto blurred = patternBackground ? QImage() : PrepareScaledNonPattern( diff --git a/Telegram/SourceFiles/boxes/calendar_box.cpp b/Telegram/SourceFiles/boxes/calendar_box.cpp index 5fdaabafe..6019df5c4 100644 --- a/Telegram/SourceFiles/boxes/calendar_box.cpp +++ b/Telegram/SourceFiles/boxes/calendar_box.cpp @@ -122,8 +122,6 @@ void CalendarBox::Context::applyMonth(const QDate &month, bool forced) { _daysCount = month.daysInMonth(); _daysShift = daysShiftForMonth(month); _rowsCount = rowsCountForMonth(month); - auto yearIndex = month.year(); - auto monthIndex = month.month(); _highlightedIndex = month.daysTo(_highlighted); _minDayIndex = _min.isNull() ? INT_MIN : month.daysTo(_min); _maxDayIndex = _max.isNull() ? INT_MAX : month.daysTo(_max); @@ -302,7 +300,6 @@ int CalendarBox::Inner::rowsTop() const { void CalendarBox::Inner::paintRows(Painter &p, QRect clip) { p.setFont(st::calendarDaysFont); - auto ms = crl::now(); auto y = rowsTop(); auto index = -_context->daysShift(); auto highlightedIndex = _context->highlightedIndex(); diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 7db93ead2..49204b557 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -1415,7 +1415,6 @@ auto ProxiesBoxController::views() const -> rpl::producer { } void ProxiesBoxController::updateView(const Item &item) { - const auto ping = 0; const auto selected = (Global::SelectedProxy() == item.data); const auto deleted = item.deleted; const auto type = [&] { diff --git a/Telegram/SourceFiles/boxes/dictionaries_manager.cpp b/Telegram/SourceFiles/boxes/dictionaries_manager.cpp index 181c83a20..b9d25586d 100644 --- a/Telegram/SourceFiles/boxes/dictionaries_manager.cpp +++ b/Telegram/SourceFiles/boxes/dictionaries_manager.cpp @@ -388,7 +388,6 @@ void ManageDictionariesBox::setInnerFocus() { void ManageDictionariesBox::prepare() { const auto multiSelect = CreateMultiSelect(this); - const auto session = &_controller->session(); const auto inner = setInnerWidget( object_ptr( this, diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index b227e6040..99decced3 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -1299,7 +1299,6 @@ crl::time PeerListContent::paintRow( p.drawTextLeft(_st.item.statusPosition.x(), _st.item.statusPosition.y(), width(), highlightedPart); } else { grayedPart = st::contactsStatusFont->elided(grayedPart, availableWidth - highlightedWidth); - auto grayedWidth = st::contactsStatusFont->width(grayedPart); p.setPen(_st.item.statusFgActive); p.drawTextLeft(_st.item.statusPosition.x(), _st.item.statusPosition.y(), width(), highlightedPart); p.setPen(selected ? _st.item.statusFgOver : _st.item.statusFg); diff --git a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp index 1ad6c8241..0010093e9 100644 --- a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp @@ -654,8 +654,6 @@ void AddSpecialBoxController::showRestricted( _editParticipantBox->closeBox(); } - const auto chat = _peer->asChat(); - const auto channel = _peer->asChannel(); const auto showRestrictedSure = crl::guard(this, [=] { showRestricted(user, true); }); diff --git a/Telegram/SourceFiles/boxes/self_destruction_box.cpp b/Telegram/SourceFiles/boxes/self_destruction_box.cpp index acc9e2427..9a167f6c4 100644 --- a/Telegram/SourceFiles/boxes/self_destruction_box.cpp +++ b/Telegram/SourceFiles/boxes/self_destruction_box.cpp @@ -62,7 +62,6 @@ void SelfDestructionBox::showContent() { _description->moveToLeft(st::boxPadding.left(), y); y += _description->height() + st::boxMediumSkip; - const auto count = int(_ttlValues.size()); for (const auto value : _ttlValues) { const auto button = Ui::CreateChild( this, diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index f74aa951e..d4cd733c7 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -1435,12 +1435,12 @@ void StickersBox::Inner::setPressed(SelectedRow pressed) { update(0, _itemsTop + pressedIndex * _rowHeight, width(), _rowHeight); auto &set = _rows[pressedIndex]; auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight)); - if (!_rows[pressedIndex]->ripple) { - _rows[pressedIndex]->ripple = std::make_unique(st::contactsRipple, std::move(rippleMask), [this, pressedIndex] { + if (!set->ripple) { + set->ripple = std::make_unique(st::contactsRipple, std::move(rippleMask), [this, pressedIndex] { update(0, _itemsTop + pressedIndex * _rowHeight, width(), _rowHeight); }); } - _rows[pressedIndex]->ripple->add(mapFromGlobal(QCursor::pos()) - QPoint(0, _itemsTop + pressedIndex * _rowHeight)); + set->ripple->add(mapFromGlobal(QCursor::pos()) - QPoint(0, _itemsTop + pressedIndex * _rowHeight)); } } diff --git a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp index c46463af4..d77ebf94e 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp @@ -698,9 +698,6 @@ QString SuggestionsController::getEmojiQuery() { cursor.movePosition(QTextCursor::End); return cursor.position(); }(); - const auto is = [&](QLatin1String string) { - return (text.compare(string, Qt::CaseInsensitive) == 0); - }; if (!_options.suggestExactFirstWord || !length || text[0].isSpace() diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index f08b62177..1c9e792a5 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -620,8 +620,6 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) { QRect r(e->rect()); if (r != rect()) p.setClipRect(r); - auto atwidth = st::mentionFont->width('@'); - auto hashwidth = st::mentionFont->width('#'); auto mentionleft = 2 * st::mentionPadding.left() + st::mentionPhotoSize; auto mentionwidth = width() - mentionleft diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index 526c17e08..6f21db7db 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -36,7 +36,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace ChatHelpers { namespace { -constexpr auto kSaveChosenTabTimeout = 1000; constexpr auto kSearchRequestDelay = 400; constexpr auto kInlineItemsMaxPerRow = 5; constexpr auto kSearchBotUsername = "gif"_cs; @@ -803,7 +802,6 @@ bool GifsListWidget::inlineItemVisible(const InlineBots::Layout::ItemBase *layou auto col = position % MatrixRowShift; Assert((row < _rows.size()) && (col < _rows[row].items.size())); - auto &inlineItems = _rows[row].items; auto top = 0; for (auto i = 0; i != row; ++i) { top += _rows[i].height; @@ -952,9 +950,7 @@ void GifsListWidget::updateSelected() { return; } - auto newSelected = -1; auto p = mapFromGlobal(_lastMousePos); - int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::buttonRadius); int sy = p.y() - st::stickerPanPadding; int row = -1, col = -1, sel = -1; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.cpp index b45a533ca..baca58e7b 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_dice_pack.cpp @@ -19,11 +19,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include namespace Stickers { -namespace { - -constexpr auto kZeroDiceDocumentId = 0xa3b83c9f84fa9e83ULL; - -} // namespace DicePack::DicePack(not_null session, const QString &emoji) : _session(session) diff --git a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp index 691144550..a4cf34643 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_emoji_pack.cpp @@ -130,7 +130,6 @@ EmojiPack::EmojiPack(not_null session) EmojiPack::~EmojiPack() = default; bool EmojiPack::add(not_null item) { - auto length = 0; if (const auto emoji = item->isolatedEmoji()) { _items[emoji].emplace(item); return true; @@ -141,7 +140,6 @@ bool EmojiPack::add(not_null item) { void EmojiPack::remove(not_null item) { Expects(item->isIsolatedEmoji()); - auto length = 0; const auto emoji = item->isolatedEmoji(); const auto i = _items.find(emoji); Assert(i != end(_items)); diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index e621f0ab2..bcd7c2d2a 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -256,8 +256,6 @@ StickersListWidget::Footer::Footer(not_null parent) void StickersListWidget::Footer::clearHeavyData() { const auto count = int(_icons.size()); const auto iconsX = qRound(_iconsX.current()); - const auto index = iconsX / st::stickerIconWidth; - const auto x = _iconsLeft - (iconsX % st::stickerIconWidth); const auto first = floorclamp(iconsX, st::stickerIconWidth, 0, count); const auto last = ceilclamp( iconsX + width(), diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index e95f3cb71..d0e403968 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp +++ b/Telegram/SourceFiles/core/crash_reports.cpp @@ -65,8 +65,6 @@ AnnotationRefs ProcessAnnotationRefs; QString ReportPath; FILE *ReportFile = nullptr; int ReportFileNo = 0; -char LaunchedDateTimeStr[32] = { 0 }; -char LaunchedBinaryName[256] = { 0 }; void SafeWriteChar(char ch) { fwrite(&ch, 1, 1, ReportFile); diff --git a/Telegram/SourceFiles/data/data_changes.cpp b/Telegram/SourceFiles/data/data_changes.cpp index a4a3320a9..8686f0ec0 100644 --- a/Telegram/SourceFiles/data/data_changes.cpp +++ b/Telegram/SourceFiles/data/data_changes.cpp @@ -33,7 +33,6 @@ template void Changes::Manager::sendRealtimeNotifications( not_null data, Flags flags) { - auto clearRealtime = false; for (auto i = 0; i != kCount; ++i) { const auto flag = static_cast(1U << i); if (flags & flag) { diff --git a/Telegram/SourceFiles/data/data_cloud_file.cpp b/Telegram/SourceFiles/data/data_cloud_file.cpp index b2c3679b4..65f3ed6a6 100644 --- a/Telegram/SourceFiles/data/data_cloud_file.cpp +++ b/Telegram/SourceFiles/data/data_cloud_file.cpp @@ -100,8 +100,6 @@ bool CloudImage::failed() const { } void CloudImage::load(not_null session, FileOrigin origin) { - const auto fromCloud = LoadFromCloudOrLocal; - const auto cacheTag = kImageCacheTag; const auto autoLoading = false; const auto finalCheck = [=] { if (const auto active = activeView()) { diff --git a/Telegram/SourceFiles/data/data_document_media.cpp b/Telegram/SourceFiles/data/data_document_media.cpp index 51c890006..28916e511 100644 --- a/Telegram/SourceFiles/data/data_document_media.cpp +++ b/Telegram/SourceFiles/data/data_document_media.cpp @@ -33,7 +33,6 @@ namespace { constexpr auto kReadAreaLimit = 12'032 * 9'024; constexpr auto kWallPaperThumbnailLimit = 960; -constexpr auto kMaxVideoFrameArea = 7'680 * 4'320; constexpr auto kGoodThumbQuality = 87; enum class FileType { diff --git a/Telegram/SourceFiles/data/data_messages.cpp b/Telegram/SourceFiles/data/data_messages.cpp index 382143af5..74c81d1a0 100644 --- a/Telegram/SourceFiles/data/data_messages.cpp +++ b/Telegram/SourceFiles/data/data_messages.cpp @@ -98,7 +98,6 @@ void MessagesList::addRange( bool incrementCount) { Expects(!count || !incrementCount); - auto wasCount = _count; auto update = MessagesSliceUpdate(); auto result = addRangeItemsAndCountNew( update, diff --git a/Telegram/SourceFiles/data/data_notify_settings.cpp b/Telegram/SourceFiles/data/data_notify_settings.cpp index a1e3b95a0..83228e7eb 100644 --- a/Telegram/SourceFiles/data/data_notify_settings.cpp +++ b/Telegram/SourceFiles/data/data_notify_settings.cpp @@ -178,7 +178,7 @@ bool NotifySettings::change( MTP_flags(flags), MTPBool(), silentPosts ? MTP_bool(*silentPosts) : MTPBool(), - muteForSeconds ? MTP_int(base::unixtime::now() + *muteForSeconds) : MTPint(), + MTP_int(muteUntil), MTPstring())); } diff --git a/Telegram/SourceFiles/data/data_photo_media.cpp b/Telegram/SourceFiles/data/data_photo_media.cpp index 1cf701921..f18c69ee3 100644 --- a/Telegram/SourceFiles/data/data_photo_media.cpp +++ b/Telegram/SourceFiles/data/data_photo_media.cpp @@ -99,7 +99,6 @@ float64 PhotoMedia::progress() const { void PhotoMedia::automaticLoad( Data::FileOrigin origin, const HistoryItem *item) { - const auto index = PhotoSizeIndex(PhotoSize::Large); if (!item || loaded() || _owner->cancelled()) { return; } diff --git a/Telegram/SourceFiles/data/data_types.cpp b/Telegram/SourceFiles/data/data_types.cpp index 39d845878..4ec0aee28 100644 --- a/Telegram/SourceFiles/data/data_types.cpp +++ b/Telegram/SourceFiles/data/data_types.cpp @@ -21,8 +21,6 @@ constexpr auto kDocumentCacheTag = 0x0000000000000100ULL; constexpr auto kDocumentCacheMask = 0x00000000000000FFULL; constexpr auto kDocumentThumbCacheTag = 0x0000000000000200ULL; constexpr auto kDocumentThumbCacheMask = 0x00000000000000FFULL; -constexpr auto kStorageCacheTag = 0x0000010000000000ULL; -constexpr auto kStorageCacheMask = 0x000000FFFFFFFFFFULL; constexpr auto kWebDocumentCacheTag = 0x0000020000000000ULL; constexpr auto kWebDocumentCacheMask = 0x000000FFFFFFFFFFULL; constexpr auto kUrlCacheTag = 0x0000030000000000ULL; diff --git a/Telegram/SourceFiles/data/data_wall_paper.cpp b/Telegram/SourceFiles/data/data_wall_paper.cpp index cd50580ef..691afcbf7 100644 --- a/Telegram/SourceFiles/data/data_wall_paper.cpp +++ b/Telegram/SourceFiles/data/data_wall_paper.cpp @@ -544,7 +544,6 @@ QImage PreparePatternImage( const auto patternBg = anim::shifted(bg); const auto patternFg = anim::shifted(fg); - const auto resultBytesPerPixel = (image.depth() >> 3); constexpr auto resultIntsPerPixel = 1; const auto resultIntsPerLine = (image.bytesPerLine() >> 2); const auto resultIntsAdded = resultIntsPerLine - width * resultIntsPerPixel; diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 0fe9f6d00..b3307a00f 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -1105,8 +1105,6 @@ void InnerWidget::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { } else { // maybe cursor on some text history item? const auto item = view ? view->data().get() : nullptr; const auto itemId = item ? item->fullId() : FullMsgId(); - bool canDelete = item && item->canDelete() && (item->id > 0 || !item->serviceMsg()); - bool canForward = item && item->allowsForward(); auto msg = dynamic_cast(item); if (isUponSelected > 0) { diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 4f5b3bf8f..6dc719a42 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -375,7 +375,7 @@ bool History::updateSendActionNeedsAnimating( }, [&](const MTPDsendMessageRecordVideoAction &) { emplaceAction(Type::RecordVideo, kStatusShowClientsideRecordVideo); }, [&](const MTPDsendMessageRecordAudioAction &) { - emplaceAction(Type::RecordVoice, kStatusShowClientsideRecordVideo); + emplaceAction(Type::RecordVoice, kStatusShowClientsideRecordVoice); }, [&](const MTPDsendMessageRecordRoundAction &) { emplaceAction(Type::RecordRound, kStatusShowClientsideRecordRound); }, [&](const MTPDsendMessageGeoLocationAction &) { diff --git a/Telegram/SourceFiles/history/history_location_manager.cpp b/Telegram/SourceFiles/history/history_location_manager.cpp index 69e93ed00..08f33f94f 100644 --- a/Telegram/SourceFiles/history/history_location_manager.cpp +++ b/Telegram/SourceFiles/history/history_location_manager.cpp @@ -14,13 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_file_origin.h" #include "platform/platform_specific.h" -namespace { - -constexpr auto kCoordPrecision = 8; -constexpr auto kMaxHttpRedirects = 5; - -} // namespace - QString LocationClickHandler::copyToClipboardText() const { return _text; } diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 36d62baca..b4353a366 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -52,8 +52,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace { -constexpr auto kPinnedMessageTextLimit = 16; - [[nodiscard]] MTPDmessage::Flags NewForwardedFlags( not_null peer, UserId from, diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 538770fb9..22a9bca29 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -118,8 +118,6 @@ namespace { constexpr auto kMessagesPerPageFirst = 30; constexpr auto kMessagesPerPage = 50; constexpr auto kPreloadHeightsCount = 3; // when 3 screens to scroll left make a preload request -constexpr auto kTabbedSelectorToggleTooltipTimeoutMs = 3000; -constexpr auto kTabbedSelectorToggleTooltipCount = 3; constexpr auto kScrollToVoiceAfterScrolledMs = 1000; constexpr auto kSkipRepaintWhileScrollMs = 100; constexpr auto kShowMembersDropdownTimeoutMs = 300; @@ -6695,9 +6693,6 @@ void HistoryWidget::drawField(Painter &p, const QRect &rect) { if (!drawWebPagePreview) { const auto firstItem = _toForward.front(); const auto firstMedia = firstItem->media(); - const auto serviceColor = (_toForward.size() > 1) - || (firstMedia != nullptr) - || firstItem->serviceMsg(); const auto preview = (_toForward.size() < 2 && firstMedia && firstMedia->hasReplyPreview()) ? firstMedia->replyPreview() : nullptr; @@ -6825,7 +6820,6 @@ void HistoryWidget::drawPinnedBar(Painter &p) { Expects(_pinnedBar != nullptr); auto top = _topBar->bottomNoMargins(); - bool serviceColor = false, hasForward = readyToForward(); p.fillRect(myrtlrect(0, top, width(), st::historyReplyHeight), st::historyPinnedBg); top += st::msgReplyPadding.top(); diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 1584fa462..12ec4f9be 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -634,9 +634,6 @@ base::unique_qptr FillContextMenu( const auto document = linkDocument ? linkDocument->document().get() : nullptr; - const auto isVideoLink = document ? document->isVideoFile() : false; - const auto isVoiceLink = document ? document->isVoiceMessage() : false; - const auto isAudioLink = document ? document->isAudioFile() : false; const auto hasSelection = !request.selectedItems.empty() || !request.selectedText.empty(); diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index f38a42067..d64e9c991 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -358,7 +358,7 @@ std::optional ListWidget::scrollTopForPosition( } const auto index = findNearestItem(position); const auto view = _items[index]; - return scrollTopForView(_items[index]); + return scrollTopForView(view); } std::optional ListWidget::scrollTopForView( @@ -1748,11 +1748,9 @@ void ListWidget::updateDragSelection() { } const auto fromView = selectingUp ? overView : pressView; const auto tillView = selectingUp ? pressView : overView; - updateDragSelection( - selectingUp ? overView : pressView, - selectingUp ? _overState : _pressState, - selectingUp ? pressView : overView, - selectingUp ? _pressState : _overState); + const auto fromState = selectingUp ? _overState : _pressState; + const auto tillState = selectingUp ? _pressState : _overState; + updateDragSelection(fromView, fromState, tillView, tillState); } void ListWidget::updateDragSelection( diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 4cdbbdded..64ce49350 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -104,42 +104,6 @@ RecentEmojiPack &GetRecentEmoji() { } } } - const auto defaultRecent = { - 0xD83DDE02LLU, - 0xD83DDE18LLU, - 0x2764LLU, - 0xD83DDE0DLLU, - 0xD83DDE0ALLU, - 0xD83DDE01LLU, - 0xD83DDC4DLLU, - 0x263ALLU, - 0xD83DDE14LLU, - 0xD83DDE04LLU, - 0xD83DDE2DLLU, - 0xD83DDC8BLLU, - 0xD83DDE12LLU, - 0xD83DDE33LLU, - 0xD83DDE1CLLU, - 0xD83DDE48LLU, - 0xD83DDE09LLU, - 0xD83DDE03LLU, - 0xD83DDE22LLU, - 0xD83DDE1DLLU, - 0xD83DDE31LLU, - 0xD83DDE21LLU, - 0xD83DDE0FLLU, - 0xD83DDE1ELLU, - 0xD83DDE05LLU, - 0xD83DDE1ALLU, - 0xD83DDE4ALLU, - 0xD83DDE0CLLU, - 0xD83DDE00LLU, - 0xD83DDE0BLLU, - 0xD83DDE06LLU, - 0xD83DDC4CLLU, - 0xD83DDE10LLU, - 0xD83DDE15LLU, - }; for (const auto emoji : Ui::Emoji::GetDefaultRecent()) { if (result.size() >= kRecentEmojiLimit) break; diff --git a/Telegram/SourceFiles/settings/settings_folders.cpp b/Telegram/SourceFiles/settings/settings_folders.cpp index 30243b1b1..568fc9000 100644 --- a/Telegram/SourceFiles/settings/settings_folders.cpp +++ b/Telegram/SourceFiles/settings/settings_folders.cpp @@ -37,7 +37,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Settings { namespace { -constexpr auto kRefreshSuggestedTimeout = 7200 * crl::time(1000); constexpr auto kFiltersLimit = 10; using Flag = Data::ChatFilter::Flag; diff --git a/Telegram/SourceFiles/storage/download_manager_mtproto.cpp b/Telegram/SourceFiles/storage/download_manager_mtproto.cpp index 53d87ec1b..6c6a590a3 100644 --- a/Telegram/SourceFiles/storage/download_manager_mtproto.cpp +++ b/Telegram/SourceFiles/storage/download_manager_mtproto.cpp @@ -349,7 +349,7 @@ void DownloadManagerMtproto::removeSession(MTP::DcId dcId) { // Make sure we don't send anything to that session while redirecting. session.requested += kMaxWaitedInSession * kMaxSessionsCount; - _queues[dcId].removeSession(index); + queue.removeSession(index); Assert(session.requested == kMaxWaitedInSession * kMaxSessionsCount); dc.sessions.pop_back(); diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 8f3e7d9c9..39bf06515 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -106,13 +106,13 @@ bool CheckStreamStatus(QDataStream &stream) { [[nodiscard]] const MTP::Config &LookupFallbackConfig() { static const auto lookupConfig = [](not_null account) { const auto mtp = &account->mtp(); - return (mtp->environment() == MTP::Environment::Production) + const auto production = MTP::Environment::Production; + return (mtp->environment() == production) ? &mtp->config() : nullptr; }; const auto &app = Core::App(); const auto &domain = app.domain(); - const auto production = MTP::Environment::Production; if (!domain.started()) { return app.fallbackProductionConfig(); } diff --git a/Telegram/SourceFiles/ui/filter_icon_panel.cpp b/Telegram/SourceFiles/ui/filter_icon_panel.cpp index 9bb41c3a5..c4df60cf6 100644 --- a/Telegram/SourceFiles/ui/filter_icon_panel.cpp +++ b/Telegram/SourceFiles/ui/filter_icon_panel.cpp @@ -22,7 +22,6 @@ namespace Ui { namespace { constexpr auto kHideTimeoutMs = crl::time(300); -constexpr auto kDelayedHideTimeoutMs = 3 * crl::time(1000); constexpr auto kIconsPerRow = 6; constexpr auto kIcons = std::array{ diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index 6470efec0..11c7236bb 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -627,7 +627,6 @@ void Generator::paintRow(const Row &row) { auto availableWidth = namewidth; if (row.unreadCounter) { auto counter = QString::number(row.unreadCounter); - auto mutedCounter = row.muted; auto unreadRight = x + fullWidth - st::dialogsPadding.x(); auto unreadTop = texttop + st::dialogsTextFont->ascent - st::dialogsUnreadFont->ascent - (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2;