Fix -Wunused-variable warnings

This commit is contained in:
Ilya Fedin 2021-07-13 21:51:07 +04:00 committed by John Preston
parent b6881022ce
commit 79cc797aff
156 changed files with 65 additions and 435 deletions

View file

@ -156,7 +156,6 @@ void SendBotCallbackDataWithPassword(
const auto session = &history->session(); const auto session = &history->session();
const auto owner = &history->owner(); const auto owner = &history->owner();
const auto api = &session->api(); const auto api = &session->api();
const auto bot = item->getMessageBot();
const auto fullId = item->fullId(); const auto fullId = item->fullId();
const auto getButton = [=] { const auto getButton = [=] {
return HistoryMessageMarkupButton::Get( return HistoryMessageMarkupButton::Get(

View file

@ -474,7 +474,6 @@ void Updates::differenceDone(const MTPupdates_Difference &result) {
stateDone(d.vstate()); stateDone(d.vstate());
} break; } break;
case mtpc_updates_differenceTooLong: { case mtpc_updates_differenceTooLong: {
auto &d = result.c_updates_differenceTooLong();
LOG(("API Error: updates.differenceTooLong is not supported by Telegram Desktop!")); LOG(("API Error: updates.differenceTooLong is not supported by Telegram Desktop!"));
} break; } break;
}; };
@ -1030,9 +1029,6 @@ void Updates::applyUpdatesNoPtsCheck(const MTPUpdates &updates) {
const auto &d = updates.c_updateShortMessage(); const auto &d = updates.c_updateShortMessage();
const auto flags = mtpCastFlags(d.vflags().v) const auto flags = mtpCastFlags(d.vflags().v)
| MTPDmessage::Flag::f_from_id; | MTPDmessage::Flag::f_from_id;
const auto peerUserId = d.is_out()
? d.vuser_id()
: MTP_int(_session->userId().bare); // #TODO ids
_session->data().addNewMessage( _session->data().addNewMessage(
MTP_message( MTP_message(
MTP_flags(flags), MTP_flags(flags),
@ -1250,7 +1246,6 @@ void Updates::applyUpdateNoPtsCheck(const MTPUpdate &update) {
case mtpc_updatePinnedMessages: { case mtpc_updatePinnedMessages: {
const auto &d = update.c_updatePinnedMessages(); const auto &d = update.c_updatePinnedMessages();
const auto peerId = peerFromMTP(d.vpeer());
for (const auto &msgId : d.vmessages().v) { for (const auto &msgId : d.vmessages().v) {
const auto item = session().data().message(0, msgId.v); const auto item = session().data().message(0, msgId.v);
if (item) { if (item) {
@ -1607,7 +1602,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
history->setUnreadMark(data.is_unread()); history->setUnreadMark(data.is_unread());
} }
}, [&](const MTPDdialogPeerFolder &dialog) { }, [&](const MTPDdialogPeerFolder &dialog) {
const auto id = dialog.vfolder_id().v; // #TODO archive //const auto id = dialog.vfolder_id().v; // #TODO archive
//if (const auto folder = session().data().folderLoaded(id)) { //if (const auto folder = session().data().folderLoaded(id)) {
// folder->setUnreadMark(data.is_unread()); // folder->setUnreadMark(data.is_unread());
//} //}
@ -1868,19 +1863,15 @@ void Updates::feedUpdate(const MTPUpdate &update) {
} break; } break;
case mtpc_updateNewEncryptedMessage: { case mtpc_updateNewEncryptedMessage: {
auto &d = update.c_updateNewEncryptedMessage();
} break; } break;
case mtpc_updateEncryptedChatTyping: { case mtpc_updateEncryptedChatTyping: {
auto &d = update.c_updateEncryptedChatTyping();
} break; } break;
case mtpc_updateEncryption: { case mtpc_updateEncryption: {
auto &d = update.c_updateEncryption();
} break; } break;
case mtpc_updateEncryptedMessagesRead: { case mtpc_updateEncryptedMessagesRead: {
auto &d = update.c_updateEncryptedMessagesRead();
} break; } break;
case mtpc_updatePhoneCall: case mtpc_updatePhoneCall:

View file

@ -3874,7 +3874,6 @@ void ApiWrap::forwardMessages(
} }
} }
const auto newFrom = item->history()->peer; const auto newFrom = item->history()->peer;
const auto newGroupId = item->groupId();
if (forwardFrom != newFrom) { if (forwardFrom != newFrom) {
sendAccumulated(); sendAccumulated();
forwardFrom = newFrom; forwardFrom = newFrom;

View file

@ -436,7 +436,6 @@ void Options::Option::updateFieldGeometry() {
const auto skip = st::defaultRadio.diameter const auto skip = st::defaultRadio.diameter
+ st::defaultCheckbox.textPosition.x(); + st::defaultCheckbox.textPosition.x();
const auto left = anim::interpolate(0, skip, shown); const auto left = anim::interpolate(0, skip, shown);
const auto width = _content->width() - left;
_field->resizeToWidth(_content->width() - left); _field->resizeToWidth(_content->width() - left);
_field->moveToLeft(left, 0); _field->moveToLeft(left, 0);
} }

View file

@ -1051,10 +1051,8 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) {
? st::msgFileThumbLayout ? st::msgFileThumbLayout
: st::msgFileLayout; : st::msgFileLayout;
const auto w = width() - padding.left() - padding.right(); const auto w = width() - padding.left() - padding.right();
const auto h = 0 + st.thumbSize + 0;
const auto nameleft = 0 + st.thumbSize + st.padding.right(); const auto nameleft = 0 + st.thumbSize + st.padding.right();
const auto nametop = st.nameTop - st.padding.top(); const auto nametop = st.nameTop - st.padding.top();
const auto nameright = 0;
const auto statustop = st.statusTop - st.padding.top(); const auto statustop = st.statusTop - st.padding.top();
const auto editButton = _isAllowedEditMedia const auto editButton = _isAllowedEditMedia
? _editFile->width() + st::editMediaButtonSkip ? _editFile->width() + st::editMediaButtonSkip

View file

@ -216,7 +216,6 @@ std::pair<Languages, Languages> PrepareLists() {
Lang::GetInstance().nativeName() Lang::GetInstance().nativeName()
}; };
}; };
const auto i = ranges::find(official, current, projId);
recent.insert(begin(recent), generate()); recent.insert(begin(recent), generate());
} }
} }

View file

@ -516,7 +516,7 @@ void LocalStorageBox::updateMediaLabel() {
} }
void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) { void LocalStorageBox::setupLimits(not_null<Ui::VerticalLayout*> container) {
const auto shadow = container->add( container->add(
object_ptr<Ui::PlainShadow>(container), object_ptr<Ui::PlainShadow>(container),
st::localStorageRowPadding); st::localStorageRowPadding);

View file

@ -1455,7 +1455,6 @@ void ParticipantsBoxController::rowActionClicked(
base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu( base::unique_qptr<Ui::PopupMenu> ParticipantsBoxController::rowContextMenu(
QWidget *parent, QWidget *parent,
not_null<PeerListRow*> row) { not_null<PeerListRow*> row) {
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel(); const auto channel = _peer->asChannel();
const auto participant = row->peer(); const auto participant = row->peer();
const auto user = participant->asUser(); const auto user = participant->asUser();
@ -1527,8 +1526,6 @@ void ParticipantsBoxController::showAdmin(not_null<UserData*> user) {
user, user,
currentRights, currentRights,
_additional.adminRank(user)); _additional.adminRank(user));
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel();
if (_additional.canAddOrEditAdmin(user)) { if (_additional.canAddOrEditAdmin(user)) {
const auto done = crl::guard(this, [=]( const auto done = crl::guard(this, [=](
ChatAdminRightsInfo newRights, ChatAdminRightsInfo newRights,
@ -1608,8 +1605,6 @@ void ParticipantsBoxController::showRestricted(not_null<UserData*> user) {
user, user,
hasAdminRights, hasAdminRights,
currentRights); currentRights);
const auto chat = _peer->asChat();
const auto channel = _peer->asChannel();
if (_additional.canRestrictParticipant(user)) { if (_additional.canRestrictParticipant(user)) {
const auto done = crl::guard(this, [=]( const auto done = crl::guard(this, [=](
ChatRestrictionsInfo newRights) { ChatRestrictionsInfo newRights) {

View file

@ -64,8 +64,6 @@ void FillContent(
return; return;
} }
const auto channel = peer->asChannel();
historyVisibility->setValue(savedValue); historyVisibility->setValue(savedValue);
const auto result = parent->add( const auto result = parent->add(

View file

@ -1313,7 +1313,6 @@ void Controller::saveLinkedChat() {
channel->setLinkedChat(*_savingData.linkedChat); channel->setLinkedChat(*_savingData.linkedChat);
continueSave(); continueSave();
}).fail([=](const MTP::Error &error) { }).fail([=](const MTP::Error &error) {
const auto &type = error.type();
cancelSave(); cancelSave();
}).send(); }).send();
} }
@ -1366,7 +1365,6 @@ void Controller::saveTitle() {
} }
void Controller::saveDescription() { void Controller::saveDescription() {
const auto channel = _peer->asChannel();
if (!_savingData.description if (!_savingData.description
|| *_savingData.description == _peer->about()) { || *_savingData.description == _peer->about()) {
return continueSave(); return continueSave();

View file

@ -832,7 +832,6 @@ void CopyInviteLink(const QString &link) {
} }
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) { void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
const auto session = &peer->session();
const auto sending = std::make_shared<bool>(); const auto sending = std::make_shared<bool>();
const auto box = std::make_shared<QPointer<ShareBox>>(); const auto box = std::make_shared<QPointer<ShareBox>>();
@ -886,8 +885,6 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
} }
const auto owner = &peer->owner(); const auto owner = &peer->owner();
auto &api = peer->session().api(); auto &api = peer->session().api();
auto &histories = owner->histories();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto peer : result) { for (const auto peer : result) {
const auto history = owner->history(peer); const auto history = owner->history(peer);
auto message = ApiWrap::MessageToSend(history); auto message = ApiWrap::MessageToSend(history);
@ -901,9 +898,6 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
(*box)->closeBox(); (*box)->closeBox();
} }
}; };
auto filterCallback = [](PeerData *peer) {
return peer->canWrite();
};
*box = Ui::show( *box = Ui::show(
Box<ShareBox>(ShareBox::Descriptor{ Box<ShareBox>(ShareBox::Descriptor{
.session = &peer->session(), .session = &peer->session(),

View file

@ -33,7 +33,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace { namespace {
constexpr auto kPreloadPages = 2;
constexpr auto kFullArcLength = 360 * 16; constexpr auto kFullArcLength = 360 * 16;
enum class Color { enum class Color {

View file

@ -533,7 +533,7 @@ Fn<int()> EditPeerPermissionsBox::addSlowmodeSlider(
return has ? aboutInterval : about; return has ? aboutInterval : about;
}); });
const auto about = container->add( container->add(
object_ptr<Ui::DividerLabel>( object_ptr<Ui::DividerLabel>(
container, container,
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(

View file

@ -539,7 +539,6 @@ void SendFilesBox::pushBlock(int from, int till) {
return controller->isGifPausedAtLeastFor( return controller->isGifPausedAtLeastFor(
Window::GifPauseReason::Layer); Window::GifPauseReason::Layer);
}; };
const auto index = int(_blocks.size());
_blocks.emplace_back( _blocks.emplace_back(
_inner.data(), _inner.data(),
&_list.files, &_list.files,

View file

@ -1113,7 +1113,6 @@ QString AppendShareGameScoreUrl(
? session->data().channelLoaded(fullId.channel) ? session->data().channelLoaded(fullId.channel)
: static_cast<ChannelData*>(nullptr); : static_cast<ChannelData*>(nullptr);
auto channelAccessHash = uint64(channel ? channel->access : 0); auto channelAccessHash = uint64(channel ? channel->access : 0);
auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
shareHashDataInts[0] = session->userId().bare; shareHashDataInts[0] = session->userId().bare;
shareHashDataInts[1] = fullId.channel.bare; shareHashDataInts[1] = fullId.channel.bare;
shareHashDataInts[2] = fullId.msg; shareHashDataInts[2] = fullId.msg;

View file

@ -688,8 +688,6 @@ void StickerSetBox::Inner::paintEvent(QPaintEvent *e) {
return; return;
} }
int32 rows = (_elements.size() / kStickersPanelPerRow)
+ ((_elements.size() % kStickersPanelPerRow) ? 1 : 0);
int32 from = qFloor(e->rect().top() / st::stickersSize.height()), to = qFloor(e->rect().bottom() / st::stickersSize.height()) + 1; int32 from = qFloor(e->rect().top() / st::stickersSize.height()), to = qFloor(e->rect().bottom() / st::stickersSize.height()) + 1;
_pathGradient->startFrame(0, width(), width() / 2); _pathGradient->startFrame(0, width(), width() / 2);

View file

@ -1702,7 +1702,6 @@ void StickersBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
_installSetCallback(_rows[_actionDown]->set->id); _installSetCallback(_rows[_actionDown]->set->id);
} }
} else if (_dragging >= 0) { } else if (_dragging >= 0) {
QPoint local(mapFromGlobal(_mouse));
_rows[_dragging]->yadd.start(0.); _rows[_dragging]->yadd.start(0.);
_aboveShadowFadeStart = _shiftingStartTimes[_dragging] = crl::now(); _aboveShadowFadeStart = _shiftingStartTimes[_dragging] = crl::now();
_aboveShadowFadeOpacity = anim::value(aboveShadowOpacity(), 0); _aboveShadowFadeOpacity = anim::value(aboveShadowOpacity(), 0);

View file

@ -48,7 +48,6 @@ enum class BarState {
namespace { namespace {
constexpr auto kMaxUsersInBar = 3;
constexpr auto kUpdateDebugTimeoutMs = crl::time(500); constexpr auto kUpdateDebugTimeoutMs = crl::time(500);
constexpr auto kSwitchStateDuration = 120; constexpr auto kSwitchStateDuration = 120;

View file

@ -31,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Calls::Group { namespace Calls::Group {
namespace { namespace {
constexpr auto kDefaultScheduleDuration = 60 * TimeId(60);
constexpr auto kLabelRefreshInterval = 10 * crl::time(1000); constexpr auto kLabelRefreshInterval = 10 * crl::time(1000);
using Context = ChooseJoinAsProcess::Context; using Context = ChooseJoinAsProcess::Context;

View file

@ -1502,7 +1502,6 @@ void GroupCall::applyParticipantLocally(
? participant->canSelfUnmute ? participant->canSelfUnmute
: (!mute || IsGroupCallAdmin(_peer, participantPeer)); : (!mute || IsGroupCallAdmin(_peer, participantPeer));
const auto isMutedByYou = mute && !canManageCall; const auto isMutedByYou = mute && !canManageCall;
const auto mutedCount = 0/*participant->mutedCount*/;
using Flag = MTPDgroupCallParticipant::Flag; using Flag = MTPDgroupCallParticipant::Flag;
const auto flags = (canSelfUnmute ? Flag::f_can_self_unmute : Flag(0)) const auto flags = (canSelfUnmute ? Flag::f_can_self_unmute : Flag(0))
| Flag::f_volume // Without flag the volume is reset to 100%. | Flag::f_volume // Without flag the volume is reset to 100%.
@ -2018,7 +2017,6 @@ void GroupCall::setupOutgoingVideo() {
// Recursive entrance may happen if error happens when activating. // Recursive entrance may happen if error happens when activating.
return (previous != state); return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) { }) | rpl::start_with_next([=](VideoState previous, VideoState state) {
const auto wasPaused = (previous == VideoState::Paused);
const auto wasActive = (previous != VideoState::Inactive); const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused); const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive); const auto nowActive = (state != VideoState::Inactive);
@ -2073,7 +2071,6 @@ void GroupCall::setupOutgoingVideo() {
// Recursive entrance may happen if error happens when activating. // Recursive entrance may happen if error happens when activating.
return (previous != state); return (previous != state);
}) | rpl::start_with_next([=](VideoState previous, VideoState state) { }) | rpl::start_with_next([=](VideoState previous, VideoState state) {
const auto wasPaused = (previous == VideoState::Paused);
const auto wasActive = (previous != VideoState::Inactive); const auto wasActive = (previous != VideoState::Inactive);
const auto nowPaused = (state == VideoState::Paused); const auto nowPaused = (state == VideoState::Paused);
const auto nowActive = (state != VideoState::Inactive); const auto nowActive = (state != VideoState::Inactive);
@ -2372,8 +2369,6 @@ void GroupCall::broadcastPartCancel(not_null<LoadPartTask*> task) {
void GroupCall::mediaChannelDescriptionsStart( void GroupCall::mediaChannelDescriptionsStart(
std::shared_ptr<MediaChannelDescriptionsTask> task) { std::shared_ptr<MediaChannelDescriptionsTask> task) {
const auto raw = task.get();
const auto real = lookupReal(); const auto real = lookupReal();
if (!real || (_instanceMode == InstanceMode::None)) { if (!real || (_instanceMode == InstanceMode::None)) {
for (const auto ssrc : task->ssrcs()) { for (const auto ssrc : task->ssrcs()) {
@ -2398,7 +2393,6 @@ bool GroupCall::mediaChannelDescriptionsFill(
auto result = false; auto result = false;
const auto real = lookupReal(); const auto real = lookupReal();
Assert(real != nullptr); Assert(real != nullptr);
const auto &existing = real->participants();
for (const auto ssrc : task->ssrcs()) { for (const auto ssrc : task->ssrcs()) {
const auto add = [&]( const auto add = [&](
std::optional<Channel> channel, std::optional<Channel> channel,
@ -2833,8 +2827,6 @@ void GroupCall::setScreenInstanceConnected(
: inTransit : inTransit
? InstanceState::TransitionToRtc ? InstanceState::TransitionToRtc
: InstanceState::Connected; : InstanceState::Connected;
const auto connected = (screenInstanceState
!= InstanceState::Disconnected);
if (_screenInstanceState.current() == screenInstanceState) { if (_screenInstanceState.current() == screenInstanceState) {
return; return;
} }
@ -3078,11 +3070,6 @@ std::variant<int, not_null<UserData*>> GroupCall::inviteUsers(
return 0; return 0;
} }
const auto owner = &_peer->owner(); const auto owner = &_peer->owner();
const auto &invited = owner->invitedToCallUsers(_id);
auto &&toInvite = users | ranges::views::filter([&](
not_null<UserData*> user) {
return !invited.contains(user) && !real->participantByPeer(user);
});
auto count = 0; auto count = 0;
auto slice = QVector<MTPInputUser>(); auto slice = QVector<MTPInputUser>();

View file

@ -41,7 +41,6 @@ namespace Calls::Group {
namespace { namespace {
constexpr auto kKeepRaisedHandStatusDuration = 3 * crl::time(1000); constexpr auto kKeepRaisedHandStatusDuration = 3 * crl::time(1000);
constexpr auto kShadowMaxAlpha = 74;
constexpr auto kUserpicSizeForBlur = 40; constexpr auto kUserpicSizeForBlur = 40;
constexpr auto kUserpicBlurRadius = 8; constexpr auto kUserpicBlurRadius = 8;
@ -496,7 +495,6 @@ void Members::Controller::subscribeToChanges(not_null<Data::GroupCall*> real) {
: update.now->peer; : update.now->peer;
if (!update.now) { if (!update.now) {
if (const auto row = findRow(participantPeer)) { if (const auto row = findRow(participantPeer)) {
const auto owner = &participantPeer->owner();
if (isMe(participantPeer)) { if (isMe(participantPeer)) {
updateRow(row, nullptr); updateRow(row, nullptr);
} else { } else {
@ -779,7 +777,6 @@ void Members::Controller::updateRow(
const Data::GroupCallParticipant *participant) { const Data::GroupCallParticipant *participant) {
const auto wasSounding = row->sounding(); const auto wasSounding = row->sounding();
const auto wasSsrc = row->ssrc(); const auto wasSsrc = row->ssrc();
const auto wasInChat = (row->state() != Row::State::Invited);
row->setSkipLevelUpdate(_skipRowLevelUpdate); row->setSkipLevelUpdate(_skipRowLevelUpdate);
row->updateState(participant); row->updateState(participant);
const auto nowSounding = row->sounding(); const auto nowSounding = row->sounding();

View file

@ -423,7 +423,6 @@ void RecordingAction::prepare(rpl::producer<QString> text) {
std::move(text) | rpl::start_with_next([=](QString text) { std::move(text) | rpl::start_with_next([=](QString text) {
const auto &padding = _st.itemPadding; const auto &padding = _st.itemPadding;
_text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions); _text.setMarkedText(_st.itemStyle, { text }, MenuTextOptions);
const auto textWidth = _text.maxWidth();
_textWidth = w - padding.left() - padding.right(); _textWidth = w - padding.left() - padding.right();
update(); update();
}, lifetime()); }, lifetime());

View file

@ -498,7 +498,6 @@ void Panel::refreshLeftButton() {
} }
void Panel::refreshVideoButtons(std::optional<bool> overrideWideMode) { void Panel::refreshVideoButtons(std::optional<bool> overrideWideMode) {
const auto real = _call->lookupReal();
const auto create = overrideWideMode.value_or(mode() == PanelMode::Wide) const auto create = overrideWideMode.value_or(mode() == PanelMode::Wide)
|| (!_call->scheduleDate() && _call->videoIsWorking()); || (!_call->scheduleDate() && _call->videoIsWorking());
const auto created = _video && _screenShare; const auto created = _video && _screenShare;
@ -1104,9 +1103,7 @@ void Panel::refreshTopButton() {
updateButtonsGeometry(); // _wideMenu <-> _settings updateButtonsGeometry(); // _wideMenu <-> _settings
return; return;
} }
const auto real = _call->lookupReal();
const auto hasJoinAs = _call->showChooseJoinAs(); const auto hasJoinAs = _call->showChooseJoinAs();
const auto wide = (_mode.current() == PanelMode::Wide);
const auto showNarrowMenu = _call->canManage() const auto showNarrowMenu = _call->canManage()
|| _call->videoIsWorking(); || _call->videoIsWorking();
const auto showNarrowUserpic = !showNarrowMenu && hasJoinAs; const auto showNarrowUserpic = !showNarrowMenu && hasJoinAs;
@ -2146,9 +2143,6 @@ void Panel::refreshTitle() {
_subtitle->setAttribute(Qt::WA_TransparentForMouseEvents); _subtitle->setAttribute(Qt::WA_TransparentForMouseEvents);
} }
if (_subtitle) { if (_subtitle) {
const auto middle = _title
? (_title->x() + _title->width() / 2)
: (widget()->width() / 2);
const auto top = _title const auto top = _title
? st::groupCallSubtitleTop ? st::groupCallSubtitleTop
: st::groupCallTitleTop; : st::groupCallTitleTop;
@ -2163,8 +2157,6 @@ void Panel::refreshTitleGeometry() {
return; return;
} }
const auto fullRect = computeTitleRect(); const auto fullRect = computeTitleRect();
const auto recordingWidth = 2 * st::groupCallRecordingMarkSkip
+ st::groupCallRecordingMark;
const auto titleRect = _recordingMark const auto titleRect = _recordingMark
? QRect( ? QRect(
fullRect.x(), fullRect.x(),

View file

@ -53,7 +53,10 @@ namespace Calls::Group {
namespace { namespace {
constexpr auto kDelaysCount = 201; constexpr auto kDelaysCount = 201;
#ifdef Q_OS_MAC
constexpr auto kCheckAccessibilityInterval = crl::time(500); constexpr auto kCheckAccessibilityInterval = crl::time(500);
#endif // Q_OS_MAC
void SaveCallJoinMuted( void SaveCallJoinMuted(
not_null<PeerData*> peer, not_null<PeerData*> peer,
@ -96,7 +99,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
const QString &linkSpeaker, const QString &linkSpeaker,
const QString &linkListener, const QString &linkListener,
Fn<void(QString)> showToast) { Fn<void(QString)> showToast) {
const auto session = &peer->session();
const auto sending = std::make_shared<bool>(); const auto sending = std::make_shared<bool>();
const auto box = std::make_shared<QPointer<ShareBox>>(); const auto box = std::make_shared<QPointer<ShareBox>>();
@ -167,8 +169,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
} }
const auto owner = &peer->owner(); const auto owner = &peer->owner();
auto &api = peer->session().api(); auto &api = peer->session().api();
auto &histories = owner->histories();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto peer : result) { for (const auto peer : result) {
const auto history = owner->history(peer); const auto history = owner->history(peer);
auto message = ApiWrap::MessageToSend(history); auto message = ApiWrap::MessageToSend(history);

View file

@ -352,7 +352,6 @@ Viewport::Layout Viewport::applyLarge(Layout layout) const {
const auto largeTop = largeRect.y(); const auto largeTop = largeRect.y();
const auto largeRight = largeLeft + largeRect.width(); const auto largeRight = largeLeft + largeRect.width();
const auto largeBottom = largeTop + largeRect.height(); const auto largeBottom = largeTop + largeRect.height();
const auto largeCenter = largeRect.center();
for (auto &geometry : list) { for (auto &geometry : list) {
if (geometry.tile == _large) { if (geometry.tile == _large) {
geometry.*field = { QPoint(), layout.outer }; geometry.*field = { QPoint(), layout.outer };

View file

@ -282,8 +282,6 @@ vec4 background() {
const auto scaled = InterpolateScaledSize(unscaled, size, expandRatio); const auto scaled = InterpolateScaledSize(unscaled, size, expandRatio);
const auto left = (size.width() - scaled.width()) / 2; const auto left = (size.width() - scaled.width()) / 2;
const auto top = (size.height() - scaled.height()) / 2; const auto top = (size.height() - scaled.height()) / 2;
const auto right = left + scaled.width();
const auto bottom = top + scaled.height();
auto dleft = float(left) / scaled.width(); auto dleft = float(left) / scaled.width();
auto dright = float(size.width() - left) / scaled.width(); auto dright = float(size.width() - left) / scaled.width();
auto dtop = float(top) / scaled.height(); auto dtop = float(top) / scaled.height();
@ -511,7 +509,6 @@ void Viewport::RendererGL::paintTile(
const auto fullNameShift = st.namePosition.y() + st::normalFont->height; const auto fullNameShift = st.namePosition.y() + st::normalFont->height;
const auto nameShift = anim::interpolate(fullNameShift, 0, shown); const auto nameShift = anim::interpolate(fullNameShift, 0, shown);
const auto row = tile->row(); const auto row = tile->row();
const auto style = row->computeIconState(MembersRowStyle::Video);
validateOutlineAnimation(tile, tileData); validateOutlineAnimation(tile, tileData);
validatePausedAnimation(tile, tileData); validatePausedAnimation(tile, tileData);
@ -1336,7 +1333,6 @@ void Viewport::RendererGL::validateDatas() {
} }
for (const auto &request : requests) { for (const auto &request : requests) {
const auto i = request.index; const auto i = request.index;
const auto index = _tileDataIndices[i];
const auto &data = _tileData[_tileDataIndices[i]]; const auto &data = _tileData[_tileDataIndices[i]];
if (data.nameRect.isEmpty()) { if (data.nameRect.isEmpty()) {
continue; continue;

View file

@ -75,10 +75,6 @@ MenuVolumeItem::MenuVolumeItem(
_speakerRect = QRect(_itemRect.topLeft(), _stCross.icon.size()); _speakerRect = QRect(_itemRect.topLeft(), _stCross.icon.size());
_arcPosition = _speakerRect.center() _arcPosition = _speakerRect.center()
+ QPoint(0, st::groupCallMenuSpeakerArcsSkip); + QPoint(0, st::groupCallMenuSpeakerArcsSkip);
const auto sliderLeft = _arcPosition.x()
+ st::groupCallMenuVolumeSkip
+ _arcs->maxWidth()
+ st::groupCallMenuVolumeSkip;
_slider->setGeometry( _slider->setGeometry(
st::groupCallMenuVolumeMargin.left(), st::groupCallMenuVolumeMargin.left(),
_speakerRect.y(), _speakerRect.y(),

View file

@ -1296,7 +1296,6 @@ void FieldAutocomplete::Inner::selectByMouse(QPoint globalPosition) {
int32 sel = -1, maxSel = 0; int32 sel = -1, maxSel = 0;
if (!_srows->empty()) { if (!_srows->empty()) {
int32 rows = rowscount(_srows->size(), _stickersPerRow);
int32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1; int32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1;
int32 col = (mouse.x() >= st::stickerPanPadding) ? ((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) : -1; int32 col = (mouse.x() >= st::stickerPanPadding) ? ((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) : -1;
if (row >= 0 && col >= 0) { if (row >= 0 && col >= 0) {

View file

@ -919,7 +919,7 @@ bool GifsListWidget::refreshInlineRows(int32 *added) {
int32 GifsListWidget::showInlineRows(bool newResults) { int32 GifsListWidget::showInlineRows(bool newResults) {
auto added = 0; auto added = 0;
auto clear = !refreshInlineRows(&added); refreshInlineRows(&added);
if (newResults) { if (newResults) {
scrollTo(0); scrollTo(0);
} }

View file

@ -1,5 +1,4 @@
/* /*
/*
This file is part of Telegram Desktop, This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service. the official desktop application for the Telegram messaging service.

View file

@ -48,7 +48,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace ChatHelpers { namespace ChatHelpers {
namespace { namespace {
constexpr auto kInlineItemsMaxPerRow = 5;
constexpr auto kSearchRequestDelay = 400; constexpr auto kSearchRequestDelay = 400;
constexpr auto kRecentDisplayLimit = 20; constexpr auto kRecentDisplayLimit = 20;
constexpr auto kPreloadOfficialPages = 4; constexpr auto kPreloadOfficialPages = 4;
@ -356,7 +355,6 @@ void StickersListWidget::Footer::returnFocus() {
void StickersListWidget::Footer::enumerateVisibleIcons( void StickersListWidget::Footer::enumerateVisibleIcons(
Fn<void(const StickerIcon &, int)> callback) { Fn<void(const StickerIcon &, int)> callback) {
auto iconsX = qRound(_iconsX.current()); auto iconsX = qRound(_iconsX.current());
auto index = iconsX / st::stickerIconWidth;
auto x = _iconsLeft - (iconsX % st::stickerIconWidth); auto x = _iconsLeft - (iconsX % st::stickerIconWidth);
auto first = floorclamp(iconsX, st::stickerIconWidth, 0, _icons.size()); auto first = floorclamp(iconsX, st::stickerIconWidth, 0, _icons.size());
auto last = ceilclamp( auto last = ceilclamp(
@ -1708,7 +1706,6 @@ void StickersListWidget::paintStickers(Painter &p, QRect clip) {
paintMegagroupEmptySet(p, info.rowsTop, buttonSelected); paintMegagroupEmptySet(p, info.rowsTop, buttonSelected);
return true; return true;
} }
auto special = (set.flags & SetFlag::Official) != 0;
auto fromRow = floorclamp(clip.y() - info.rowsTop, _singleSize.height(), 0, info.rowsCount); auto fromRow = floorclamp(clip.y() - info.rowsTop, _singleSize.height(), 0, info.rowsCount);
auto toRow = ceilclamp(clip.y() + clip.height() - info.rowsTop, _singleSize.height(), 0, info.rowsCount); auto toRow = ceilclamp(clip.y() + clip.height() - info.rowsTop, _singleSize.height(), 0, info.rowsCount);
for (int i = fromRow; i < toRow; ++i) { for (int i = fromRow; i < toRow; ++i) {
@ -1867,7 +1864,6 @@ void StickersListWidget::ensureLottiePlayer(Set &set) {
raw->updates( raw->updates(
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
const auto &sets = shownSets();
enumerateSections([&](const SectionInfo &info) { enumerateSections([&](const SectionInfo &info) {
if (shownSets()[info.section].lottiePlayer.get() == raw) { if (shownSets()[info.section].lottiePlayer.get() == raw) {
update( update(
@ -2879,7 +2875,6 @@ void StickersListWidget::updateSelected() {
newSelected = OverGroupAdd {}; newSelected = OverGroupAdd {};
} }
} else { } else {
auto special = ((set.flags & SetFlag::Official) != 0);
auto rowIndex = qFloor(yOffset / _singleSize.height()); auto rowIndex = qFloor(yOffset / _singleSize.height());
auto columnIndex = qFloor(sx / _singleSize.width()); auto columnIndex = qFloor(sx / _singleSize.width());
auto index = rowIndex * _columnCount + columnIndex; auto index = rowIndex * _columnCount + columnIndex;

View file

@ -161,7 +161,6 @@ void TabbedPanel::updateContentHeight() {
return; return;
} }
auto was = _contentHeight;
_contentHeight = contentHeight; _contentHeight = contentHeight;
resize(QRect(0, 0, innerRect().width(), _contentHeight).marginsAdded(innerPadding()).size()); resize(QRect(0, 0, innerRect().width(), _contentHeight).marginsAdded(innerPadding()).size());

View file

@ -130,8 +130,6 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
_frameAlpha = anim::interpolate(1, 256, opacity); _frameAlpha = anim::interpolate(1, 256, opacity);
auto frameInts = _frameInts + _innerLeft + _innerTop * _frameIntsPerLine;
auto leftToRight = (_direction == Direction::LeftToRight); auto leftToRight = (_direction == Direction::LeftToRight);
auto easeOut = anim::easeOutCirc(1., dt); auto easeOut = anim::easeOutCirc(1., dt);
@ -241,7 +239,7 @@ void TabbedSelector::SlideAnimation::paintFrame(QPainter &p, float64 dt, float64
} }
// Debug // Debug
//frameInts = _frameInts; //auto frameInts = _frameInts;
//auto pattern = anim::shifted((static_cast<uint32>(0xFF) << 24) | (static_cast<uint32>(0xFF) << 16) | (static_cast<uint32>(0xFF) << 8) | static_cast<uint32>(0xFF)); //auto pattern = anim::shifted((static_cast<uint32>(0xFF) << 24) | (static_cast<uint32>(0xFF) << 16) | (static_cast<uint32>(0xFF) << 8) | static_cast<uint32>(0xFF));
//for (auto y = 0; y != _finalHeight; ++y) { //for (auto y = 0; y != _finalHeight; ++y) {
// for (auto x = 0; x != _finalWidth; ++x) { // for (auto x = 0; x != _finalWidth; ++x) {
@ -938,7 +936,6 @@ void TabbedSelector::switchTab() {
} }
const auto wasSectionIcons = hasSectionIcons(); const auto wasSectionIcons = hasSectionIcons();
const auto wasTab = _currentTabType;
const auto wasIndex = indexByType(_currentTabType); const auto wasIndex = indexByType(_currentTabType);
currentTab()->saveScrollTop(); currentTab()->saveScrollTop();
@ -1154,7 +1151,6 @@ int TabbedSelector::Inner::resizeGetHeight(int newWidth) {
} }
int TabbedSelector::Inner::minimalHeight() const { int TabbedSelector::Inner::minimalHeight() const {
auto result = _minimalHeight;
return (_minimalHeight > 0) return (_minimalHeight > 0)
? _minimalHeight ? _minimalHeight
: (st::emojiPanMaxHeight - st::emojiFooterHeight); : (st::emojiPanMaxHeight - st::emojiFooterHeight);

View file

@ -283,7 +283,6 @@ bool Should(
if (document->sticker()) { if (document->sticker()) {
return true; return true;
} }
const auto size = document->size;
return Should(data, Source::User, document) return Should(data, Source::User, document)
|| Should(data, Source::Group, document) || Should(data, Source::Group, document)
|| Should(data, Source::Channel, document); || Should(data, Source::Channel, document);

View file

@ -528,10 +528,6 @@ bool GroupCall::requestParticipantsAfterReload(
void GroupCall::applyParticipantsSlice( void GroupCall::applyParticipantsSlice(
const QVector<MTPGroupCallParticipant> &list, const QVector<MTPGroupCallParticipant> &list,
ApplySliceSource sliceSource) { ApplySliceSource sliceSource) {
const auto amInCall = inCall();
const auto now = base::unixtime::now();
const auto speakingAfterActive = TimeId(kSpeakingAfterActive / 1000);
for (const auto &participant : list) { for (const auto &participant : list) {
participant.match([&](const MTPDgroupCallParticipant &data) { participant.match([&](const MTPDgroupCallParticipant &data) {
const auto participantPeerId = peerFromMTP(data.vpeer()); const auto participantPeerId = peerFromMTP(data.vpeer());
@ -568,10 +564,6 @@ void GroupCall::applyParticipantsSlice(
|| data.is_can_self_unmute(); || data.is_can_self_unmute();
const auto lastActive = data.vactive_date().value_or( const auto lastActive = data.vactive_date().value_or(
was ? was->lastActive : 0); was ? was->lastActive : 0);
const auto speaking = canSelfUnmute
&& ((was ? was->speaking : false)
|| (!amInCall
&& (lastActive + speakingAfterActive > now)));
const auto volume = (was const auto volume = (was
&& !was->applyVolumeFromMin && !was->applyVolumeFromMin
&& data.is_min()) && data.is_min())

View file

@ -268,7 +268,6 @@ bool MessagesList::empty() const {
rpl::producer<MessagesResult> MessagesList::viewer( rpl::producer<MessagesResult> MessagesList::viewer(
MessagesQuery &&query) const { MessagesQuery &&query) const {
auto copy = query;
return rpl::single( return rpl::single(
queryCurrent(query) queryCurrent(query)
) | rpl::then(sliceUpdated() | rpl::map([=] { ) | rpl::then(sliceUpdated() | rpl::map([=] {

View file

@ -13,7 +13,6 @@ namespace Data {
namespace { namespace {
MTPinputPeerNotifySettings DefaultSettings() { MTPinputPeerNotifySettings DefaultSettings() {
const auto flags = MTPDpeerNotifySettings::Flag::f_show_previews;
return MTP_inputPeerNotifySettings( return MTP_inputPeerNotifySettings(
MTP_flags(0), MTP_flags(0),
MTPBool(), MTPBool(),

View file

@ -68,7 +68,6 @@ namespace Data {
namespace { namespace {
constexpr auto kMaxNotifyCheckDelay = 24 * 3600 * crl::time(1000); constexpr auto kMaxNotifyCheckDelay = 24 * 3600 * crl::time(1000);
constexpr auto kMaxWallpaperSize = 10 * 1024 * 1024;
using ViewElement = HistoryView::Element; using ViewElement = HistoryView::Element;
@ -183,7 +182,6 @@ std::vector<UnavailableReason> ExtractUnavailableReasons(
[[nodiscard]] std::optional<MTPVideoSize> FindDocumentVideoThumbnail( [[nodiscard]] std::optional<MTPVideoSize> FindDocumentVideoThumbnail(
const MTPDdocument &data) { const MTPDdocument &data) {
const auto area = [](const MTPVideoSize &size) { const auto area = [](const MTPVideoSize &size) {
static constexpr auto kInvalid = 0;
return size.match([](const MTPDvideoSize &data) { return size.match([](const MTPDvideoSize &data) {
return (data.vw().v * data.vh().v); return (data.vw().v * data.vh().v);
}); });
@ -1044,7 +1042,6 @@ void Session::registerSendAction(
if (sendAction->updateNeedsAnimating(user, action)) { if (sendAction->updateNeedsAnimating(user, action)) {
user->madeAction(when); user->madeAction(when);
const auto i = _sendActions.find(std::pair{ history, rootId });
if (!_sendActions.contains(std::pair{ history, rootId })) { if (!_sendActions.contains(std::pair{ history, rootId })) {
_sendActions.emplace(std::pair{ history, rootId }, crl::now()); _sendActions.emplace(std::pair{ history, rootId }, crl::now());
_sendActionsAnimation.start(); _sendActionsAnimation.start();
@ -2575,7 +2572,6 @@ void Session::photoApplyFields(
const MTPDphoto &data) { const MTPDphoto &data) {
const auto &sizes = data.vsizes().v; const auto &sizes = data.vsizes().v;
const auto progressive = [&] { const auto progressive = [&] {
const auto kInvalidIndex = sizes.size();
const auto area = [&](const MTPPhotoSize &size) { const auto area = [&](const MTPPhotoSize &size) {
return size.match([](const MTPDphotoSizeProgressive &data) { return size.match([](const MTPDphotoSizeProgressive &data) {
return data.vw().v * data.vh().v; return data.vw().v * data.vh().v;
@ -4062,7 +4058,6 @@ void Session::insertCheckedServiceNotification(
const TextWithEntities &message, const TextWithEntities &message,
const MTPMessageMedia &media, const MTPMessageMedia &media,
TimeId date) { TimeId date) {
const auto history = this->history(PeerData::kServiceNotificationsId);
const auto flags = MTPDmessage::Flag::f_entities const auto flags = MTPDmessage::Flag::f_entities
| MTPDmessage::Flag::f_from_id | MTPDmessage::Flag::f_from_id
| MTPDmessage::Flag::f_media; | MTPDmessage::Flag::f_media;

View file

@ -22,11 +22,8 @@ constexpr auto kDocumentCacheMask = 0x00000000000000FFULL;
constexpr auto kDocumentThumbCacheTag = 0x0000000000000200ULL; constexpr auto kDocumentThumbCacheTag = 0x0000000000000200ULL;
constexpr auto kDocumentThumbCacheMask = 0x00000000000000FFULL; constexpr auto kDocumentThumbCacheMask = 0x00000000000000FFULL;
constexpr auto kWebDocumentCacheTag = 0x0000020000000000ULL; constexpr auto kWebDocumentCacheTag = 0x0000020000000000ULL;
constexpr auto kWebDocumentCacheMask = 0x000000FFFFFFFFFFULL;
constexpr auto kUrlCacheTag = 0x0000030000000000ULL; constexpr auto kUrlCacheTag = 0x0000030000000000ULL;
constexpr auto kUrlCacheMask = 0x000000FFFFFFFFFFULL;
constexpr auto kGeoPointCacheTag = 0x0000040000000000ULL; constexpr auto kGeoPointCacheTag = 0x0000040000000000ULL;
constexpr auto kGeoPointCacheMask = 0x000000FFFFFFFFFFULL;
} // namespace } // namespace

View file

@ -1344,7 +1344,6 @@ StickersSet *Stickers::feedSetFull(const MTPmessages_StickerSet &data) {
} }
void Stickers::newSetReceived(const MTPmessages_StickerSet &data) { void Stickers::newSetReceived(const MTPmessages_StickerSet &data) {
bool writeArchived = false;
const auto &set = data.c_messages_stickerSet(); const auto &set = data.c_messages_stickerSet();
const auto &s = set.vset().c_stickerSet(); const auto &s = set.vset().c_stickerSet();
if (!s.vinstalled_date()) { if (!s.vinstalled_date()) {

View file

@ -697,10 +697,6 @@ void InnerWidget::paintCollapsedRow(
bool selected) const { bool selected) const {
Expects(row->folder != nullptr); Expects(row->folder != nullptr);
const auto smallWidth = st::dialogsPadding.x()
+ st::dialogsPhotoSize
+ st::dialogsPhotoPadding;
const auto narrow = (width() <= smallWidth);
const auto text = row->folder->chatListName(); const auto text = row->folder->chatListName();
const auto unread = row->folder->chatListUnreadCount(); const auto unread = row->folder->chatListUnreadCount();
Layout::PaintCollapsedRow( Layout::PaintCollapsedRow(
@ -2584,7 +2580,7 @@ void InnerWidget::loadPeerPhotos() {
int32 from = (yFrom - filteredOffset()) / st::dialogsRowHeight; int32 from = (yFrom - filteredOffset()) / st::dialogsRowHeight;
if (from < 0) from = 0; if (from < 0) from = 0;
if (from < _filterResults.size()) { if (from < _filterResults.size()) {
int32 to = (yTo / int32(st::dialogsRowHeight)) + 1, w = width(); int32 to = (yTo / int32(st::dialogsRowHeight)) + 1;
if (to > _filterResults.size()) to = _filterResults.size(); if (to > _filterResults.size()) to = _filterResults.size();
for (; from < to; ++from) { for (; from < to; ++from) {
@ -2595,7 +2591,7 @@ void InnerWidget::loadPeerPhotos() {
from = (yFrom > filteredOffset() + st::searchedBarHeight ? ((yFrom - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size(); from = (yFrom > filteredOffset() + st::searchedBarHeight ? ((yFrom - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size();
if (from < 0) from = 0; if (from < 0) from = 0;
if (from < _peerSearchResults.size()) { if (from < _peerSearchResults.size()) {
int32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1, w = width(); int32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1;
if (to > _peerSearchResults.size()) to = _peerSearchResults.size(); if (to > _peerSearchResults.size()) to = _peerSearchResults.size();
for (; from < to; ++from) { for (; from < to; ++from) {
@ -2605,7 +2601,7 @@ void InnerWidget::loadPeerPhotos() {
from = (yFrom > filteredOffset() + ((_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight) ? ((yFrom - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size(); from = (yFrom > filteredOffset() + ((_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight) ? ((yFrom - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size();
if (from < 0) from = 0; if (from < 0) from = 0;
if (from < _searchResults.size()) { if (from < _searchResults.size()) {
int32 to = (yTo > filteredOffset() + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight ? ((yTo - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size() + 1, w = width(); int32 to = (yTo > filteredOffset() + (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) + st::searchedBarHeight ? ((yTo - filteredOffset() - (_peerSearchResults.empty() ? 0 : st::searchedBarHeight) - st::searchedBarHeight) / int32(st::dialogsRowHeight)) : 0) - _filterResults.size() - _peerSearchResults.size() + 1;
if (to > _searchResults.size()) to = _searchResults.size(); if (to > _searchResults.size()) to = _searchResults.size();
for (; from < to; ++from) { for (; from < to; ++from) {
@ -2680,7 +2676,6 @@ bool InnerWidget::chooseHashtag() {
} }
ChosenRow InnerWidget::computeChosenRow() const { ChosenRow InnerWidget::computeChosenRow() const {
auto msgId = ShowAtUnreadMsgId;
if (_state == WidgetState::Default) { if (_state == WidgetState::Default) {
if (_selected) { if (_selected) {
return { return {
@ -2747,7 +2742,6 @@ RowDescriptor InnerWidget::chatListEntryBefore(
} }
const auto whichHistory = which.key.history(); const auto whichHistory = which.key.history();
const auto whichFullId = which.fullId;
if (!whichHistory) { if (!whichHistory) {
return RowDescriptor(); return RowDescriptor();
} }
@ -2825,7 +2819,6 @@ RowDescriptor InnerWidget::chatListEntryAfter(
} }
const auto whichHistory = which.key.history(); const auto whichHistory = which.key.history();
const auto whichFullId = which.fullId;
if (!whichHistory) { if (!whichHistory) {
return RowDescriptor(); return RowDescriptor();
} }

View file

@ -700,7 +700,6 @@ void Widget::startSlideAnimation() {
_folderTopBar->hide(); _folderTopBar->hide();
} }
int delta = st::slideShift;
if (_showDirection == Window::SlideDirection::FromLeft) { if (_showDirection == Window::SlideDirection::FromLeft) {
std::swap(_cacheUnder, _cacheOver); std::swap(_cacheUnder, _cacheOver);
} }

View file

@ -269,7 +269,6 @@ void ColorPicker::paintOutline(Painter &p, const QRectF &rect) {
return; return;
} }
const auto draw = [&](float opacity) { const auto draw = [&](float opacity) {
const auto was = p.opacity();
p.save(); p.save();
p.setOpacity(opacity); p.setOpacity(opacity);
p.setPen(Qt::lightGray); p.setPen(Qt::lightGray);

View file

@ -399,7 +399,6 @@ void PhotoEditorControls::showAnimated(
const auto duration = st::photoEditorBarAnimationDuration; const auto duration = st::photoEditorBarAnimationDuration;
const auto isTransform = (mode == Mode::Transform); const auto isTransform = (mode == Mode::Transform);
const auto isPaint = (mode == Mode::Paint);
const auto buttonsLeft = (width() - _transformButtons->width()) / 2; const auto buttonsLeft = (width() - _transformButtons->width()) / 2;
const auto buttonsTop = bottomButtonsTop(); const auto buttonsTop = bottomButtonsTop();

View file

@ -29,8 +29,6 @@ namespace Export {
namespace Data { namespace Data {
namespace { namespace {
constexpr auto kUserPeerIdShift = (1ULL << 32);
constexpr auto kChatPeerIdShift = (2ULL << 32);
constexpr auto kMaxImageSize = 10000; constexpr auto kMaxImageSize = 10000;
constexpr auto kMigratedMessagesIdShift = -1'000'000'000; constexpr auto kMigratedMessagesIdShift = -1'000'000'000;
@ -546,7 +544,6 @@ Poll ParsePoll(const MTPDmessageMediaPoll &data) {
if (const auto resultsList = results.vresults()) { if (const auto resultsList = results.vresults()) {
for (const auto &single : resultsList->v) { for (const auto &single : resultsList->v) {
single.match([&](const MTPDpollAnswerVoters &voters) { single.match([&](const MTPDpollAnswerVoters &voters) {
const auto &option = voters.voption().v;
const auto i = ranges::find( const auto i = ranges::find(
result.answers, result.answers,
voters.voption().v, voters.voption().v,

View file

@ -24,7 +24,7 @@ namespace {
constexpr auto kUserpicsSliceLimit = 100; constexpr auto kUserpicsSliceLimit = 100;
constexpr auto kFileChunkSize = 128 * 1024; constexpr auto kFileChunkSize = 128 * 1024;
constexpr auto kFileRequestsCount = 2; constexpr auto kFileRequestsCount = 2;
constexpr auto kFileNextRequestDelay = crl::time(20); //constexpr auto kFileNextRequestDelay = crl::time(20);
constexpr auto kChatsSliceLimit = 100; constexpr auto kChatsSliceLimit = 100;
constexpr auto kMessagesSliceLimit = 100; constexpr auto kMessagesSliceLimit = 100;
constexpr auto kTopPeerSliceLimit = 100; constexpr auto kTopPeerSliceLimit = 100;
@ -251,7 +251,7 @@ auto ApiWrap::RequestBuilder<Request>::done(
FnMut<void()> &&handler FnMut<void()> &&handler
) -> RequestBuilder& { ) -> RequestBuilder& {
if (handler) { if (handler) {
auto &silence_warning = _builder.done(std::move(handler)); [[maybe_unused]] auto &silence_warning = _builder.done(std::move(handler));
} }
return *this; return *this;
} }
@ -261,7 +261,7 @@ auto ApiWrap::RequestBuilder<Request>::done(
FnMut<void(Response &&)> &&handler FnMut<void(Response &&)> &&handler
) -> RequestBuilder& { ) -> RequestBuilder& {
if (handler) { if (handler) {
auto &silence_warning = _builder.done(std::move(handler)); [[maybe_unused]] auto &silence_warning = _builder.done(std::move(handler));
} }
return *this; return *this;
} }
@ -271,7 +271,7 @@ auto ApiWrap::RequestBuilder<Request>::fail(
Fn<bool(const MTP::Error &)> &&handler Fn<bool(const MTP::Error &)> &&handler
) -> RequestBuilder& { ) -> RequestBuilder& {
if (handler) { if (handler) {
auto &silence_warning = _builder.fail([ [[maybe_unused]] auto &silence_warning = _builder.fail([
common = base::take(_commonFailHandler), common = base::take(_commonFailHandler),
specific = std::move(handler) specific = std::move(handler)
](const MTP::Error &error) { ](const MTP::Error &error) {

View file

@ -2656,7 +2656,6 @@ Result HtmlWriter::writeSections() {
} }
QByteArray HtmlWriter::wrapMessageLink(int messageId, QByteArray text) { QByteArray HtmlWriter::wrapMessageLink(int messageId, QByteArray text) {
const auto finishedCount = _lastMessageIdsPerFile.size();
const auto it = ranges::find_if(_lastMessageIdsPerFile, [&](int maxMessageId) { const auto it = ranges::find_if(_lastMessageIdsPerFile, [&](int maxMessageId) {
return messageId <= maxMessageId; return messageId <= maxMessageId;
}); });

View file

@ -41,7 +41,6 @@ Content ContentFromState(
return; return;
} }
const auto substepsTotal = state.substepsTotal; const auto substepsTotal = state.substepsTotal;
const auto step = static_cast<int>(state.step);
const auto done = state.substepsPassed; const auto done = state.substepsPassed;
const auto add = state.substepsNow; const auto add = state.substepsNow;
const auto doneProgress = done / float64(substepsTotal); const auto doneProgress = done / float64(substepsTotal);

View file

@ -64,7 +64,7 @@ void ChooseFormatBox(
using Format = Output::Format; using Format = Output::Format;
const auto group = std::make_shared<Ui::RadioenumGroup<Format>>(format); const auto group = std::make_shared<Ui::RadioenumGroup<Format>>(format);
const auto addFormatOption = [&](QString label, Format format) { const auto addFormatOption = [&](QString label, Format format) {
const auto radio = box->addRow( box->addRow(
object_ptr<Ui::Radioenum<Format>>( object_ptr<Ui::Radioenum<Format>>(
box, box,
group, group,
@ -261,7 +261,7 @@ void SettingsWidget::setupPathAndFormat(
}); });
}); });
const auto addFormatOption = [&](QString label, Format format) { const auto addFormatOption = [&](QString label, Format format) {
const auto radio = container->add( container->add(
object_ptr<Ui::Radioenum<Format>>( object_ptr<Ui::Radioenum<Format>>(
container, container,
formatGroup, formatGroup,
@ -582,7 +582,7 @@ not_null<Ui::Checkbox*> SettingsWidget::addOptionWithAbout(
Types types, Types types,
const QString &about) { const QString &about) {
const auto result = addOption(container, text, types); const auto result = addOption(container, text, types);
const auto label = container->add( container->add(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
container, container,
about, about,

View file

@ -919,7 +919,6 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
? _selectedText ? _selectedText
: TextSelection(); : TextSelection();
view->draw(p, clip.translated(0, -top), selection, ms); view->draw(p, clip.translated(0, -top), selection, ms);
const auto item = view->data();
auto height = view->height(); auto height = view->height();
top += height; top += height;
p.translate(0, height); p.translate(0, height);
@ -1024,7 +1023,6 @@ auto InnerWidget::viewForItem(const HistoryItem *item) -> Element* {
} }
void InnerWidget::paintEmpty(Painter &p) { void InnerWidget::paintEmpty(Painter &p) {
style::font font(st::msgServiceFont);
auto rectWidth = st::historyAdminLogEmptyWidth; auto rectWidth = st::historyAdminLogEmptyWidth;
auto innerWidth = rectWidth - st::historyAdminLogEmptyPadding.left() - st::historyAdminLogEmptyPadding.right(); auto innerWidth = rectWidth - st::historyAdminLogEmptyPadding.left() - st::historyAdminLogEmptyPadding.right();
auto rectHeight = st::historyAdminLogEmptyPadding.top() + _emptyText.countHeight(innerWidth) + st::historyAdminLogEmptyPadding.bottom(); auto rectHeight = st::historyAdminLogEmptyPadding.top() + _emptyText.countHeight(innerWidth) + st::historyAdminLogEmptyPadding.bottom();
@ -1734,7 +1732,7 @@ void InnerWidget::updateSelected() {
void InnerWidget::performDrag() { void InnerWidget::performDrag() {
if (_mouseAction != MouseAction::Dragging) return; if (_mouseAction != MouseAction::Dragging) return;
auto uponSelected = false; //auto uponSelected = false;
//if (_mouseActionItem) { //if (_mouseActionItem) {
// if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) { // if (!_selected.isEmpty() && _selected.cbegin().value() == FullSelection) {
// uponSelected = _selected.contains(_mouseActionItem); // uponSelected = _selected.contains(_mouseActionItem);

View file

@ -880,7 +880,6 @@ void GenerateItems(
auto createChangeLinkedChat = [&](const MTPDchannelAdminLogEventActionChangeLinkedChat &action) { auto createChangeLinkedChat = [&](const MTPDchannelAdminLogEventActionChangeLinkedChat &action) {
const auto broadcast = channel->isBroadcast(); const auto broadcast = channel->isBroadcast();
const auto was = history->owner().channelLoaded(action.vprev_value().v);
const auto now = history->owner().channelLoaded(action.vnew_value().v); const auto now = history->owner().channelLoaded(action.vnew_value().v);
if (!now) { if (!now) {
auto text = (broadcast auto text = (broadcast

View file

@ -54,7 +54,6 @@ namespace {
constexpr auto kNewBlockEachMessage = 50; constexpr auto kNewBlockEachMessage = 50;
constexpr auto kSkipCloudDraftsFor = TimeId(2); constexpr auto kSkipCloudDraftsFor = TimeId(2);
constexpr auto kSendingDraftTime = TimeId(-1);
using UpdateFlag = Data::HistoryUpdate::Flag; using UpdateFlag = Data::HistoryUpdate::Flag;
@ -1223,7 +1222,7 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice) {
} }
void History::addNewerSlice(const QVector<MTPMessage> &slice) { void History::addNewerSlice(const QVector<MTPMessage> &slice) {
bool wasEmpty = isEmpty(), wasLoadedAtBottom = loadedAtBottom(); bool wasLoadedAtBottom = loadedAtBottom();
if (slice.isEmpty()) { if (slice.isEmpty()) {
_loadedAtBottom = true; _loadedAtBottom = true;
@ -1758,7 +1757,6 @@ void History::setFolderPointer(Data::Folder *folder) {
if (isPinnedDialog(FilterId())) { if (isPinnedDialog(FilterId())) {
owner().setChatPinned(this, FilterId(), false); owner().setChatPinned(this, FilterId(), false);
} }
auto &filters = owner().chatsFilters();
const auto wasKnown = folderKnown(); const auto wasKnown = folderKnown();
const auto wasInList = inChatList(); const auto wasInList = inChatList();
if (wasInList) { if (wasInList) {
@ -2045,7 +2043,6 @@ void History::finishBuildingFrontBlock() {
if (const auto block = base::take(_buildingFrontBlock)->block) { if (const auto block = base::take(_buildingFrontBlock)->block) {
if (blocks.size() > 1) { if (blocks.size() > 1) {
// ... item, item, item, last ], [ first, item, item ... // ... item, item, item, last ], [ first, item, item ...
const auto last = block->messages.back().get();
const auto first = blocks[1]->messages.front().get(); const auto first = blocks[1]->messages.front().get();
// we've added a new front block, so previous item for // we've added a new front block, so previous item for

View file

@ -901,7 +901,6 @@ void HistoryInner::touchDeaccelerate(int32 elapsed) {
} }
void HistoryInner::touchEvent(QTouchEvent *e) { void HistoryInner::touchEvent(QTouchEvent *e) {
const Qt::TouchPointStates &states(e->touchPointStates());
if (e->type() == QEvent::TouchCancel) { // cancel if (e->type() == QEvent::TouchCancel) { // cancel
if (!_touchInProgress) return; if (!_touchInProgress) return;
_touchInProgress = false; _touchInProgress = false;
@ -2105,7 +2104,6 @@ void HistoryInner::checkHistoryActivation() {
auto block = _history->blocks[_curBlock].get(); auto block = _history->blocks[_curBlock].get();
auto view = block->messages[_curItem].get(); auto view = block->messages[_curItem].get();
while (_curBlock > 0 || _curItem > 0) { while (_curBlock > 0 || _curItem > 0) {
const auto top = itemTop(view);
const auto bottom = itemTop(view) + view->height(); const auto bottom = itemTop(view) + view->height();
if (_visibleAreaBottom >= bottom) { if (_visibleAreaBottom >= bottom) {
break; break;

View file

@ -531,7 +531,6 @@ void ReplyKeyboard::updateMessageId() {
void ReplyKeyboard::resize(int width, int height) { void ReplyKeyboard::resize(int width, int height) {
_width = width; _width = width;
auto markup = _item->Get<HistoryMessageReplyMarkup>();
auto y = 0.; auto y = 0.;
auto buttonHeight = _rows.empty() auto buttonHeight = _rows.empty()
? float64(_st->buttonHeight()) ? float64(_st->buttonHeight())

View file

@ -154,7 +154,6 @@ constexpr auto kFullDayInMs = 86400 * 1000;
constexpr auto kSaveDraftTimeout = 1000; constexpr auto kSaveDraftTimeout = 1000;
constexpr auto kSaveDraftAnywayTimeout = 5000; constexpr auto kSaveDraftAnywayTimeout = 5000;
constexpr auto kSaveCloudDraftIdleTimeout = 14000; constexpr auto kSaveCloudDraftIdleTimeout = 14000;
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kRefreshSlowmodeLabelTimeout = crl::time(200); constexpr auto kRefreshSlowmodeLabelTimeout = crl::time(200);
constexpr auto kCommonModifiers = 0 constexpr auto kCommonModifiers = 0
| Qt::ShiftModifier | Qt::ShiftModifier
@ -2576,12 +2575,10 @@ void HistoryWidget::messagesReceived(PeerData *peer, const MTPmessages_Messages
} }
if (_preloadRequest == requestId) { if (_preloadRequest == requestId) {
auto to = toMigrated ? _migrated : _history;
addMessagesToFront(peer, *histList); addMessagesToFront(peer, *histList);
_preloadRequest = 0; _preloadRequest = 0;
preloadHistoryIfNeeded(); preloadHistoryIfNeeded();
} else if (_preloadDownRequest == requestId) { } else if (_preloadDownRequest == requestId) {
auto to = toMigrated ? _migrated : _history;
addMessagesToBack(peer, *histList); addMessagesToBack(peer, *histList);
_preloadDownRequest = 0; _preloadDownRequest = 0;
preloadHistoryIfNeeded(); preloadHistoryIfNeeded();
@ -3370,7 +3367,6 @@ PeerData *HistoryWidget::peer() const {
// Sometimes _showAtMsgId is set directly. // Sometimes _showAtMsgId is set directly.
void HistoryWidget::setMsgId(MsgId showAtMsgId) { void HistoryWidget::setMsgId(MsgId showAtMsgId) {
if (_showAtMsgId != showAtMsgId) { if (_showAtMsgId != showAtMsgId) {
auto wasMsgId = _showAtMsgId;
_showAtMsgId = showAtMsgId; _showAtMsgId = showAtMsgId;
if (_history) { if (_history) {
controller()->setActiveChatEntry({ controller()->setActiveChatEntry({
@ -5644,7 +5640,6 @@ void HistoryWidget::setupGroupCallTracker() {
_groupCallBar->joinClicks() _groupCallBar->joinClicks()
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
const auto peer = _history->peer; const auto peer = _history->peer;
const auto channel = peer->asChannel();
if (peer->groupCall()) { if (peer->groupCall()) {
controller()->startOrJoinGroupCall(peer); controller()->startOrJoinGroupCall(peer);
} }

View file

@ -58,7 +58,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace HistoryView { namespace HistoryView {
namespace { namespace {
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kSaveDraftTimeout = crl::time(1000); constexpr auto kSaveDraftTimeout = crl::time(1000);
constexpr auto kSaveDraftAnywayTimeout = 5 * crl::time(1000); constexpr auto kSaveDraftAnywayTimeout = 5 * crl::time(1000);
constexpr auto kMouseEvents = { constexpr auto kMouseEvents = {

View file

@ -43,8 +43,6 @@ using SendActionUpdate = VoiceRecordBar::SendActionUpdate;
using VoiceToSend = VoiceRecordBar::VoiceToSend; using VoiceToSend = VoiceRecordBar::VoiceToSend;
constexpr auto kAudioVoiceUpdateView = crl::time(200); constexpr auto kAudioVoiceUpdateView = crl::time(200);
constexpr auto kLockDelay = crl::time(100);
constexpr auto kRecordingUpdateDelta = crl::time(100);
constexpr auto kAudioVoiceMaxLength = 100 * 60; // 100 minutes constexpr auto kAudioVoiceMaxLength = 100 * 60; // 100 minutes
constexpr auto kMaxSamples = constexpr auto kMaxSamples =
::Media::Player::kDefaultFrequency * kAudioVoiceMaxLength; ::Media::Player::kDefaultFrequency * kAudioVoiceMaxLength;

View file

@ -58,8 +58,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace HistoryView { namespace HistoryView {
namespace { namespace {
// If we can't cloud-export link for such time we export it locally.
constexpr auto kExportLocalTimeout = crl::time(1000);
constexpr auto kRescheduleLimit = 20; constexpr auto kRescheduleLimit = 20;
MsgId ItemIdAcrossData(not_null<HistoryItem*> item) { MsgId ItemIdAcrossData(not_null<HistoryItem*> item) {
@ -772,7 +770,6 @@ void AddReportAction(
return; return;
} }
const auto owner = &item->history()->owner(); const auto owner = &item->history()->owner();
const auto asGroup = (request.pointState != PointState::GroupPart);
const auto controller = list->controller(); const auto controller = list->controller();
const auto itemId = item->fullId(); const auto itemId = item->fullId();
const auto callback = crl::guard(controller, [=] { const auto callback = crl::guard(controller, [=] {
@ -898,7 +895,6 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
const auto rawLink = link.get(); const auto rawLink = link.get();
const auto linkPhoto = dynamic_cast<PhotoClickHandler*>(rawLink); const auto linkPhoto = dynamic_cast<PhotoClickHandler*>(rawLink);
const auto linkDocument = dynamic_cast<DocumentClickHandler*>(rawLink); const auto linkDocument = dynamic_cast<DocumentClickHandler*>(rawLink);
const auto linkPeer = dynamic_cast<PeerClickHandler*>(rawLink);
const auto photo = linkPhoto ? linkPhoto->photo().get() : nullptr; const auto photo = linkPhoto ? linkPhoto->photo().get() : nullptr;
const auto document = linkDocument const auto document = linkDocument
? linkDocument->document().get() ? linkDocument->document().get()

View file

@ -274,7 +274,6 @@ void UnreadBar::paint(Painter &p, int y, int w, bool chatWide) const {
p.setFont(st::historyUnreadBarFont); p.setFont(st::historyUnreadBarFont);
p.setPen(st::historyUnreadBarFg); p.setPen(st::historyUnreadBarFg);
int left = st::msgServiceMargin.left();
int maxwidth = w; int maxwidth = w;
if (chatWide) { if (chatWide) {
maxwidth = qMin( maxwidth = qMin(

View file

@ -2378,7 +2378,6 @@ void ListWidget::mouseActionUpdate() {
if (dateTop <= point.y()) { if (dateTop <= point.y()) {
auto opacity = (dateInPlace/* || noFloatingDate*/) ? 1. : scrollDateOpacity; auto opacity = (dateInPlace/* || noFloatingDate*/) ? 1. : scrollDateOpacity;
if (opacity > 0.) { if (opacity > 0.) {
const auto item = view->data();
auto dateWidth = 0; auto dateWidth = 0;
if (const auto date = view->Get<HistoryView::DateBadge>()) { if (const auto date = view->Get<HistoryView::DateBadge>()) {
dateWidth = date->width; dateWidth = date->width;
@ -2427,7 +2426,6 @@ void ListWidget::mouseActionUpdate() {
const auto message = view->data()->toHistoryMessage(); const auto message = view->data()->toHistoryMessage();
Assert(message != nullptr); Assert(message != nullptr);
const auto from = message->displayFrom();
dragState = TextState(nullptr, view->fromPhotoLink()); dragState = TextState(nullptr, view->fromPhotoLink());
_overItemExact = session().data().message(dragState.itemId); _overItemExact = session().data().message(dragState.itemId);
lnkhost = view; lnkhost = view;
@ -2449,7 +2447,6 @@ void ListWidget::mouseActionUpdate() {
Ui::Tooltip::Show(1000, this); Ui::Tooltip::Show(1000, this);
} }
auto cursor = style::cur_default;
if (_mouseAction == MouseAction::None) { if (_mouseAction == MouseAction::None) {
_mouseCursorState = dragState.cursor; _mouseCursorState = dragState.cursor;
auto cursor = computeMouseCursor(); auto cursor = computeMouseCursor();

View file

@ -385,7 +385,6 @@ QSize Message::performCountOptimalSize() {
const auto reply = displayedReply(); const auto reply = displayedReply();
const auto via = item->Get<HistoryMessageVia>(); const auto via = item->Get<HistoryMessageVia>();
const auto entry = logEntryOriginal(); const auto entry = logEntryOriginal();
const auto views = item->Get<HistoryMessageViews>();
if (forwarded) { if (forwarded) {
forwarded->create(via); forwarded->create(via);
} }
@ -955,7 +954,6 @@ void Message::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const
const auto forwarded = item->Get<HistoryMessageForwarded>(); const auto forwarded = item->Get<HistoryMessageForwarded>();
const auto &serviceFont = st::msgServiceFont; const auto &serviceFont = st::msgServiceFont;
const auto &serviceName = st::msgServiceNameFont;
const auto skip1 = forwarded->psaType.isEmpty() const auto skip1 = forwarded->psaType.isEmpty()
? 0 ? 0
: st::historyPsaIconSkip1; : st::historyPsaIconSkip1;
@ -1023,7 +1021,6 @@ void Message::paintForwardedInfo(Painter &p, QRect &trect, bool selected) const
} }
void Message::paintReplyInfo(Painter &p, QRect &trect, bool selected) const { void Message::paintReplyInfo(Painter &p, QRect &trect, bool selected) const {
const auto item = message();
if (auto reply = displayedReply()) { if (auto reply = displayedReply()) {
int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
@ -1081,7 +1078,6 @@ PointState Message::pointState(QPoint point) const {
// Entry page is always a bubble bottom. // Entry page is always a bubble bottom.
auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || (entry/* && entry->isBubbleBottom()*/); auto mediaOnBottom = (mediaDisplayed && media->isBubbleBottom()) || (entry/* && entry->isBubbleBottom()*/);
auto mediaOnTop = (mediaDisplayed && media->isBubbleTop()) || (entry && entry->isBubbleTop());
if (item->repliesAreComments() || item->externalReply()) { if (item->repliesAreComments() || item->externalReply()) {
g.setHeight(g.height() - st::historyCommentsButtonHeight); g.setHeight(g.height() - st::historyCommentsButtonHeight);
@ -1564,7 +1560,6 @@ bool Message::getStateReplyInfo(
QPoint point, QPoint point,
QRect &trect, QRect &trect,
not_null<TextState*> outResult) const { not_null<TextState*> outResult) const {
const auto item = message();
if (auto reply = displayedReply()) { if (auto reply = displayedReply()) {
int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); int32 h = st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
if (point.y() >= trect.top() && point.y() < trect.top() + h) { if (point.y() >= trect.top() && point.y() < trect.top() + h) {
@ -1629,7 +1624,6 @@ void Message::updatePressed(QPoint point) {
if (drawBubble()) { if (drawBubble()) {
auto mediaDisplayed = media && media->isDisplayed(); auto mediaDisplayed = media && media->isDisplayed();
auto top = marginTop();
auto trect = g.marginsAdded(-st::msgPadding); auto trect = g.marginsAdded(-st::msgPadding);
if (mediaDisplayed && media->isBubbleTop()) { if (mediaDisplayed && media->isBubbleTop()) {
trect.setY(trect.y() - st::msgPadding.top()); trect.setY(trect.y() - st::msgPadding.top());
@ -1656,7 +1650,6 @@ void Message::updatePressed(QPoint point) {
trect.setHeight(trect.height() + st::msgPadding.bottom()); trect.setHeight(trect.height() + st::msgPadding.bottom());
} }
auto needDateCheck = true;
if (mediaDisplayed) { if (mediaDisplayed) {
auto mediaHeight = media->height(); auto mediaHeight = media->height();
auto mediaLeft = trect.x() - st::msgPadding.left(); auto mediaLeft = trect.x() - st::msgPadding.left();
@ -2506,7 +2499,6 @@ TextSelection Message::unskipTextSelection(TextSelection selection) const {
QRect Message::countGeometry() const { QRect Message::countGeometry() const {
const auto commentsRoot = (context() == Context::Replies) const auto commentsRoot = (context() == Context::Replies)
&& data()->isDiscussionPost(); && data()->isDiscussionPost();
const auto item = message();
const auto media = this->media(); const auto media = this->media();
const auto mediaWidth = (media && media->isDisplayed()) const auto mediaWidth = (media && media->isDisplayed())
? media->width() ? media->width()
@ -2658,9 +2650,6 @@ int Message::resizeContentGetHeight(int newWidth) {
const auto skip1 = forwarded->psaType.isEmpty() const auto skip1 = forwarded->psaType.isEmpty()
? 0 ? 0
: st::historyPsaIconSkip1; : st::historyPsaIconSkip1;
const auto skip2 = forwarded->psaType.isEmpty()
? 0
: st::historyPsaIconSkip2;
const auto fwdheight = ((forwarded->text.maxWidth() > (contentWidth - st::msgPadding.left() - st::msgPadding.right() - skip1)) ? 2 : 1) * st::semiboldFont->height; const auto fwdheight = ((forwarded->text.maxWidth() > (contentWidth - st::msgPadding.left() - st::msgPadding.right() - skip1)) ? 2 : 1) * st::semiboldFont->height;
newHeight += fwdheight; newHeight += fwdheight;
} }
@ -2697,7 +2686,6 @@ bool Message::hasVisibleText() const {
} }
QSize Message::performCountCurrentSize(int newWidth) { QSize Message::performCountCurrentSize(int newWidth) {
const auto item = message();
const auto newHeight = resizeContentGetHeight(newWidth); const auto newHeight = resizeContentGetHeight(newWidth);
return { newWidth, newHeight }; return { newWidth, newHeight };

View file

@ -544,7 +544,6 @@ rpl::producer<Data::MessagesSlice> PinnedWidget::listSource(
Data::MessagePosition aroundId, Data::MessagePosition aroundId,
int limitBefore, int limitBefore,
int limitAfter) { int limitAfter) {
const auto channelId = peerToChannel(_history->peer->id);
const auto messageId = aroundId.fullId.msg const auto messageId = aroundId.fullId.msg
? aroundId.fullId.msg ? aroundId.fullId.msg
: (ServerMaxMsgId - 1); : (ServerMaxMsgId - 1);

View file

@ -115,7 +115,6 @@ void PinnedTracker::refreshCurrentFromSlice() {
const auto i = _migratedPeer const auto i = _migratedPeer
? ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj1) ? ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj1)
: ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj2); : ranges::lower_bound(_slice.ids, _aroundId, ranges::less(), proj2);
const auto empty = _slice.ids.empty();
const auto before = int(i - begin(_slice.ids)); const auto before = int(i - begin(_slice.ids));
const auto after = int(end(_slice.ids) - i); const auto after = int(end(_slice.ids) - i);
const auto haveValidData = (before > 0 || _slice.skippedBefore == 0) const auto haveValidData = (before > 0 || _slice.skippedBefore == 0)

View file

@ -634,7 +634,6 @@ bool RepliesWidget::confirmSendingFiles(
Api::SendType::Normal, Api::SendType::Normal,
SendMenu::Type::SilentOnly); // #TODO replies schedule SendMenu::Type::SilentOnly); // #TODO replies schedule
const auto replyTo = replyToId();
box->setConfirmedCallback(crl::guard(this, [=]( box->setConfirmedCallback(crl::guard(this, [=](
Ui::PreparedList &&list, Ui::PreparedList &&list,
Ui::SendFilesWay way, Ui::SendFilesWay way,

View file

@ -581,7 +581,6 @@ void Service::draw(
} }
PointState Service::pointState(QPoint point) const { PointState Service::pointState(QPoint point) const {
const auto item = message();
const auto media = this->media(); const auto media = this->media();
auto g = countGeometry(); auto g = countGeometry();
@ -705,7 +704,6 @@ void EmptyPainter::paint(Painter &p, int width, int height) {
)->maxWidth(); )->maxWidth();
const auto &font = st::serviceTextStyle.font; const auto &font = st::serviceTextStyle.font;
const auto margin = st::msgMargin.left();
const auto maxBubbleWidth = width - 2 * st::historyGroupAboutMargin; const auto maxBubbleWidth = width - 2 * st::historyGroupAboutMargin;
const auto padding = st::historyGroupAboutPadding; const auto padding = st::historyGroupAboutPadding;
const auto bubbleWidth = std::min( const auto bubbleWidth = std::min(

View file

@ -15,7 +15,6 @@ namespace HistoryView {
WebPageText TitleAndDescriptionFromWebPage(not_null<WebPageData*> d) { WebPageText TitleAndDescriptionFromWebPage(not_null<WebPageData*> d) {
QString resultTitle, resultDescription; QString resultTitle, resultDescription;
const auto document = d->document; const auto document = d->document;
const auto photo = d->photo;
const auto author = d->author; const auto author = d->author;
const auto siteName = d->siteName; const auto siteName = d->siteName;
const auto title = d->title; const auto title = d->title;

View file

@ -74,7 +74,7 @@ QSize Call::countOptimalSize() {
void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintw = width();
auto outbg = _parent->hasOutLayout(); auto outbg = _parent->hasOutLayout();
auto selected = (selection == FullSelection); auto selected = (selection == FullSelection);
@ -89,8 +89,6 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m
nameright = st::msgFileLayout.padding.left(); nameright = st::msgFileLayout.padding.left();
statustop = st::historyCallStatusTop - topMinus; statustop = st::historyCallStatusTop - topMinus;
auto namewidth = paintw - nameleft - nameright;
p.setFont(st::semiboldFont); p.setFont(st::semiboldFont);
p.setPen(outbg ? (selected ? st::historyFileNameOutFgSelected : st::historyFileNameOutFg) : (selected ? st::historyFileNameInFgSelected : st::historyFileNameInFg)); p.setPen(outbg ? (selected ? st::historyFileNameOutFgSelected : st::historyFileNameOutFg) : (selected ? st::historyFileNameInFgSelected : st::historyFileNameInFg));
p.drawTextLeft(nameleft, nametop, paintw, _text); p.drawTextLeft(nameleft, nametop, paintw, _text);

View file

@ -150,7 +150,7 @@ QSize Contact::countOptimalSize() {
void Contact::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void Contact::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintw = width();
auto outbg = _parent->hasOutLayout(); auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection); bool selected = (selection == FullSelection);

View file

@ -152,7 +152,6 @@ Document::Document(
not_null<DocumentData*> document) not_null<DocumentData*> document)
: File(parent, realParent) : File(parent, realParent)
, _data(document) { , _data(document) {
const auto item = parent->data();
auto caption = createCaption(); auto caption = createCaption();
createComponents(!caption.isEmpty()); createComponents(!caption.isEmpty());
@ -703,7 +702,6 @@ TextState Document::textState(
StateRequest request, StateRequest request,
LayoutMode mode) const { LayoutMode mode) const {
const auto width = layout.width(); const auto width = layout.width();
const auto height = layout.height();
auto result = TextState(_parent); auto result = TextState(_parent);
@ -714,7 +712,7 @@ TextState Document::textState(
ensureDataMediaCreated(); ensureDataMediaCreated();
bool loaded = dataLoaded(); bool loaded = dataLoaded();
bool showPause = updateStatusText(); updateStatusText();
const auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus; const auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus;
const auto thumbed = Get<HistoryDocumentThumbed>(); const auto thumbed = Get<HistoryDocumentThumbed>();
@ -724,7 +722,6 @@ TextState Document::textState(
const auto nameleft = st.padding.left() + st.thumbSize + st.padding.right(); const auto nameleft = st.padding.left() + st.thumbSize + st.padding.right();
const auto nametop = st.nameTop - topMinus; const auto nametop = st.nameTop - topMinus;
const auto nameright = st.padding.left(); const auto nameright = st.padding.left();
const auto statustop = st.statusTop - topMinus;
const auto linktop = st.linkTop - topMinus; const auto linktop = st.linkTop - topMinus;
const auto bottom = st.padding.top() + st.thumbSize + st.padding.bottom() - topMinus; const auto bottom = st.padding.top() + st.thumbSize + st.padding.bottom() - topMinus;
const auto rthumb = style::rtlrect(st.padding.left(), st.padding.top() - topMinus, st.thumbSize, st.thumbSize, width); const auto rthumb = style::rtlrect(st.padding.left(), st.padding.top() - topMinus, st.thumbSize, st.thumbSize, width);
@ -841,7 +838,6 @@ bool Document::hasTextForCopy() const {
TextForMimeData Document::selectedText(TextSelection selection) const { TextForMimeData Document::selectedText(TextSelection selection) const {
if (const auto captioned = Get<HistoryDocumentCaptioned>()) { if (const auto captioned = Get<HistoryDocumentCaptioned>()) {
const auto &caption = captioned->_caption;
return captioned->_caption.toTextForMimeData(selection); return captioned->_caption.toTextForMimeData(selection);
} }
return TextForMimeData(); return TextForMimeData();

View file

@ -90,7 +90,6 @@ QSize Game::countOptimalSize() {
} }
// init dimensions // init dimensions
auto l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth(); auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth; auto maxWidth = skipBlockWidth;
auto minHeight = 0; auto minHeight = 0;
@ -201,14 +200,13 @@ TextSelection Game::fromDescriptionSelection(
void Game::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void Game::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintw = width(), painth = height(); auto paintw = width();
auto outbg = _parent->hasOutLayout(); auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection); bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor); auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg); auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();
@ -277,7 +275,7 @@ TextState Game::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) { if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result; return result;
} }
auto paintw = width(), painth = height(); auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();

View file

@ -715,7 +715,6 @@ TextState Gif::cornerStatusTextState(
return result; return result;
} }
const auto padding = st::msgDateImgPadding; const auto padding = st::msgDateImgPadding;
const auto addWidth = st::historyVideoDownloadSize + 2 * padding.y() - padding.x();
const auto statusX = position.x() + st::msgDateImgDelta + padding.x(); const auto statusX = position.x() + st::msgDateImgDelta + padding.x();
const auto statusY = position.y() + st::msgDateImgDelta + padding.y(); const auto statusY = position.y() + st::msgDateImgDelta + padding.y();
const auto inner = QRect(statusX + padding.y() - padding.x(), statusY, st::historyVideoDownloadSize, st::historyVideoDownloadSize); const auto inner = QRect(statusX + padding.y() - padding.x(), statusY, st::historyVideoDownloadSize, st::historyVideoDownloadSize);
@ -928,9 +927,6 @@ void Gif::drawGrouped(
const auto streamingMode = _streamed || autoplay; const auto streamingMode = _streamed || autoplay;
const auto activeOwnPlaying = activeOwnStreamed(); const auto activeOwnPlaying = activeOwnStreamed();
auto paintx = geometry.x(), painty = geometry.y(), paintw = geometry.width(), painth = geometry.height();
auto displayMute = false;
const auto streamed = activeOwnPlaying const auto streamed = activeOwnPlaying
? &activeOwnPlaying->instance ? &activeOwnPlaying->instance
: nullptr; : nullptr;
@ -1257,9 +1253,7 @@ void Gif::setStatusSize(int newSize) const {
void Gif::updateStatusText() const { void Gif::updateStatusText() const {
ensureDataMediaCreated(); ensureDataMediaCreated();
auto showPause = false;
auto statusSize = 0; auto statusSize = 0;
auto realDuration = 0;
if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) { if (_data->status == FileDownloadFailed || _data->status == FileUploadFailed) {
statusSize = Ui::FileStatusSizeFailed; statusSize = Ui::FileStatusSizeFailed;
} else if (_data->uploading()) { } else if (_data->uploading()) {

View file

@ -99,7 +99,6 @@ QSize Invoice::countOptimalSize() {
} }
// init dimensions // init dimensions
auto l = st::msgPadding.left(), r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth(); auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth; auto maxWidth = skipBlockWidth;
auto minHeight = 0; auto minHeight = 0;
@ -202,14 +201,12 @@ void Invoice::refreshParentId(not_null<HistoryItem*> realParent) {
void Invoice::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void Invoice::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintw = width(), painth = height(); auto paintw = width();
auto outbg = _parent->hasOutLayout(); auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection); bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg); auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();
@ -252,7 +249,6 @@ void Invoice::draw(Painter &p, const QRect &r, TextSelection selection, crl::tim
p.translate(attachLeft, attachTop); p.translate(attachLeft, attachTop);
_attach->draw(p, r.translated(-attachLeft, -attachTop), attachSelection, ms); _attach->draw(p, r.translated(-attachLeft, -attachTop), attachSelection, ms);
auto pixwidth = _attach->width(); auto pixwidth = _attach->width();
auto pixheight = _attach->height();
auto available = _status.maxWidth(); auto available = _status.maxWidth();
auto statusW = available + 2 * st::msgDateImgPadding.x(); auto statusW = available + 2 * st::msgDateImgPadding.x();
@ -279,7 +275,7 @@ TextState Invoice::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) { if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result; return result;
} }
auto paintw = width(), painth = height(); auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();

View file

@ -77,7 +77,6 @@ QSize UnwrappedMedia::countCurrentSize(int newWidth) {
const auto item = _parent->data(); const auto item = _parent->data();
accumulate_min(newWidth, maxWidth()); accumulate_min(newWidth, maxWidth());
if (_parent->media() == this) { if (_parent->media() == this) {
const auto infoWidth = _parent->infoWidth() + 2 * st::msgDateImgPadding.x();
const auto via = item->Get<HistoryMessageVia>(); const auto via = item->Get<HistoryMessageVia>();
const auto reply = _parent->displayedReply(); const auto reply = _parent->displayedReply();
const auto forwarded = getDisplayedForwardedInfo(); const auto forwarded = getDisplayedForwardedInfo();

View file

@ -307,9 +307,6 @@ int Poll::countAnswerTop(
} }
tshift += _question.countHeight(innerWidth) + st::historyPollSubtitleSkip; tshift += _question.countHeight(innerWidth) + st::historyPollSubtitleSkip;
tshift += st::msgDateFont->height + st::historyPollAnswersSkip; tshift += st::msgDateFont->height + st::historyPollAnswersSkip;
auto &&answers = ranges::views::zip(
_answers,
ranges::views::ints(0, int(_answers.size())));
const auto i = ranges::find( const auto i = ranges::find(
_answers, _answers,
&answer, &answer,
@ -338,8 +335,6 @@ int Poll::countAnswerHeight(
} }
QSize Poll::countCurrentSize(int newWidth) { QSize Poll::countCurrentSize(int newWidth) {
const auto paddings = st::msgPadding.left() + st::msgPadding.right();
accumulate_min(newWidth, maxWidth()); accumulate_min(newWidth, maxWidth());
const auto innerWidth = newWidth const auto innerWidth = newWidth
- st::msgPadding.left() - st::msgPadding.left()
@ -722,7 +717,7 @@ void Poll::updateAnswerVotes() {
void Poll::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void Poll::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintw = width();
checkSendingAnimation(); checkSendingAnimation();
_poll->checkResultsReload(_parent->data(), ms); _poll->checkResultsReload(_parent->data(), ms);
@ -1173,7 +1168,6 @@ void Poll::paintPercent(
int outerWidth, int outerWidth,
TextSelection selection) const { TextSelection selection) const {
const auto outbg = _parent->hasOutLayout(); const auto outbg = _parent->hasOutLayout();
const auto selected = (selection == FullSelection);
const auto aleft = left + st::historyPollAnswerPadding.left(); const auto aleft = left + st::historyPollAnswerPadding.left();
top += st::historyPollAnswerPadding.top(); top += st::historyPollAnswerPadding.top();
@ -1329,9 +1323,6 @@ TextState Poll::textState(QPoint point, StateRequest request) const {
return result; return result;
} }
tshift += st::msgDateFont->height + st::historyPollAnswersSkip; tshift += st::msgDateFont->height + st::historyPollAnswersSkip;
const auto awidth = paintw
- st::historyPollAnswerPadding.left()
- st::historyPollAnswerPadding.right();
for (const auto &answer : _answers) { for (const auto &answer : _answers) {
const auto height = countAnswerHeight(answer, paintw); const auto height = countAnswerHeight(answer, paintw);
if (point.y() >= tshift && point.y() < tshift + height) { if (point.y() >= tshift && point.y() < tshift + height) {
@ -1384,7 +1375,6 @@ auto Poll::bubbleRoll() const -> BubbleRoll {
if (!_wrongAnswerAnimated) { if (!_wrongAnswerAnimated) {
return BubbleRoll(); return BubbleRoll();
} }
const auto rotateFull = value * kRotateSegments;
const auto progress = [](float64 full) { const auto progress = [](float64 full) {
const auto lower = std::floor(full); const auto lower = std::floor(full);
const auto shift = (full - lower); const auto shift = (full - lower);

View file

@ -122,11 +122,8 @@ void ThemeDocument::draw(Painter &p, const QRect &r, TextSelection selection, cr
auto loaded = dataLoaded(); auto loaded = dataLoaded();
auto displayLoading = _data->displayLoading(); auto displayLoading = _data->displayLoading();
auto inWebPage = (_parent->media() != this);
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto captionw = paintw - st::msgPadding.left() - st::msgPadding.right();
if (displayLoading) { if (displayLoading) {
ensureAnimation(); ensureAnimation();
if (!_animation->radial.animating()) { if (!_animation->radial.animating()) {
@ -270,7 +267,6 @@ TextState ThemeDocument::textState(QPoint point, StateRequest request) const {
return result; return result;
} }
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintx = 0, painty = 0, paintw = width(), painth = height();
auto bubble = _parent->hasBubble();
if (QRect(paintx, painty, paintw, painth).contains(point)) { if (QRect(paintx, painty, paintw, painth).contains(point)) {
if (_data->uploading()) { if (_data->uploading()) {
result.link = _cancell; result.link = _cancell;

View file

@ -241,7 +241,6 @@ QSize WebPage::countOptimalSize() {
} }
// init dimensions // init dimensions
auto l = st::msgPadding.left() + st::webPageLeft, r = st::msgPadding.right();
auto skipBlockWidth = _parent->skipBlockWidth(); auto skipBlockWidth = _parent->skipBlockWidth();
auto maxWidth = skipBlockWidth; auto maxWidth = skipBlockWidth;
auto minHeight = 0; auto minHeight = 0;
@ -449,14 +448,13 @@ void WebPage::unloadHeavyPart() {
void WebPage::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const { void WebPage::draw(Painter &p, const QRect &r, TextSelection selection, crl::time ms) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return; if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintw = width();
auto outbg = _parent->hasOutLayout(); auto outbg = _parent->hasOutLayout();
bool selected = (selection == FullSelection); bool selected = (selection == FullSelection);
auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor); auto &barfg = selected ? (outbg ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (outbg ? st::msgOutReplyBarColor : st::msgInReplyBarColor);
auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg); auto &semibold = selected ? (outbg ? st::msgOutServiceFgSelected : st::msgInServiceFgSelected) : (outbg ? st::msgOutServiceFg : st::msgInServiceFg);
auto &regular = selected ? (outbg ? st::msgOutDateFgSelected : st::msgInDateFgSelected) : (outbg ? st::msgOutDateFg : st::msgInDateFg);
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();
@ -479,7 +477,6 @@ void WebPage::draw(Painter &p, const QRect &r, TextSelection selection, crl::tim
if (asArticle()) { if (asArticle()) {
ensurePhotoMediaCreated(); ensurePhotoMediaCreated();
const auto contextId = _parent->data()->fullId();
QPixmap pix; QPixmap pix;
auto pw = qMax(_pixw, lineHeight); auto pw = qMax(_pixw, lineHeight);
auto ph = _pixh; auto ph = _pixh;
@ -599,7 +596,7 @@ TextState WebPage::textState(QPoint point, StateRequest request) const {
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) { if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) {
return result; return result;
} }
auto paintx = 0, painty = 0, paintw = width(), painth = height(); auto paintw = width();
QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins()); QMargins bubble(_attach ? _attach->bubbleMargins() : QMargins());
auto padding = inBubblePadding(); auto padding = inBubblePadding();

View file

@ -100,7 +100,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) { void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento); _inner->restoreState(memento);
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop()); scrollTopRestore(memento->scrollTop());
} }

View file

@ -401,7 +401,6 @@ void ListWidget::Section::paint(
const Context &context, const Context &context,
QRect clip, QRect clip,
int outerWidth) const { int outerWidth) const {
auto baseIndex = 0;
auto header = headerHeight(); auto header = headerHeight();
if (QRect(0, 0, outerWidth, header).intersects(clip)) { if (QRect(0, 0, outerWidth, header).intersects(clip)) {
p.setPen(st::infoMediaHeaderFg); p.setPen(st::infoMediaHeaderFg);
@ -412,17 +411,6 @@ void ListWidget::Section::paint(
outerWidth - 2 * st::infoMediaHeaderPosition.x(), outerWidth - 2 * st::infoMediaHeaderPosition.x(),
outerWidth); outerWidth);
} }
auto top = header + _itemsTop;
auto fromcol = floorclamp(
clip.x() - _itemsLeft,
_itemWidth,
0,
_itemsInRow);
auto tillcol = ceilclamp(
clip.x() + clip.width() - _itemsLeft,
_itemWidth,
0,
_itemsInRow);
auto localContext = context.layoutContext; auto localContext = context.layoutContext;
localContext.isAfterDate = (header > 0); localContext.isAfterDate = (header > 0);
@ -718,7 +706,6 @@ void ListWidget::itemRemoved(not_null<const HistoryItem*> item) {
auto sectionIt = findSectionByItem(id); auto sectionIt = findSectionByItem(id);
if (sectionIt != _sections.end()) { if (sectionIt != _sections.end()) {
if (sectionIt->removeItem(id)) { if (sectionIt->removeItem(id)) {
auto top = sectionIt->top();
if (sectionIt->empty()) { if (sectionIt->empty()) {
_sections.erase(sectionIt); _sections.erase(sectionIt);
} }
@ -1852,7 +1839,6 @@ void ListWidget::mouseActionUpdate(const QPoint &globalPosition) {
point - geometry.topLeft(), point - geometry.topLeft(),
inside inside
}; };
auto item = layout ? layout->getItem() : nullptr;
if (_overLayout != layout) { if (_overLayout != layout) {
repaintItem(_overLayout); repaintItem(_overLayout);
_overLayout = layout; _overLayout = layout;
@ -1972,7 +1958,6 @@ void ListWidget::updateDragSelection() {
} }
for (auto &layoutItem : _layouts) { for (auto &layoutItem : _layouts) {
auto &&universalId = layoutItem.first; auto &&universalId = layoutItem.first;
auto &&layout = layoutItem.second;
if (universalId <= fromId && universalId > tillId) { if (universalId <= fromId && universalId > tillId) {
changeItemSelection( changeItemSelection(
_dragSelected, _dragSelected,

View file

@ -92,7 +92,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) { void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento->state()); _inner->restoreState(memento->state());
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop()); scrollTopRestore(memento->scrollTop());
} }

View file

@ -668,7 +668,6 @@ int InnerWidget::desiredHeight() const {
} }
void InnerWidget::setupContent() { void InnerWidget::setupContent() {
const auto quiz = _poll->quiz();
_content->add( _content->add(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
_content, _content,

View file

@ -103,7 +103,6 @@ void Widget::saveState(not_null<Memento*> memento) {
void Widget::restoreState(not_null<Memento*> memento) { void Widget::restoreState(not_null<Memento*> memento) {
_inner->restoreState(memento); _inner->restoreState(memento);
auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop()); scrollTopRestore(memento->scrollTop());
} }

View file

@ -106,7 +106,6 @@ void Widget::saveState(not_null<Memento*> memento) {
} }
void Widget::restoreState(not_null<Memento*> memento) { void Widget::restoreState(not_null<Memento*> memento) {
const auto scrollTop = memento->scrollTop();
scrollTopRestore(memento->scrollTop()); scrollTopRestore(memento->scrollTop());
} }

View file

@ -459,7 +459,6 @@ void Sticker::unloadHeavyPart() {
void Sticker::paint(Painter &p, const QRect &clip, const PaintContext *context) const { void Sticker::paint(Painter &p, const QRect &clip, const PaintContext *context) const {
ensureDataMediaCreated(getShownDocument()); ensureDataMediaCreated(getShownDocument());
bool loaded = _dataMedia->loaded();
auto over = _a_over.value(_active ? 1. : 0.); auto over = _a_over.value(_active ? 1. : 0.);
if (over > 0) { if (over > 0) {
@ -726,7 +725,6 @@ void Video::initDimensions() {
description = _duration; description = _duration;
} }
_description.setText(st::defaultTextStyle, description, descriptionOpts); _description.setText(st::defaultTextStyle, description, descriptionOpts);
int32 descriptionHeight = qMin(_description.countHeight(textWidth), descriptionLines * st::normalFont->height);
_minh = st::inlineThumbSize; _minh = st::inlineThumbSize;
_minh += st::inlineRowMargin * 2 + st::inlineRowBorder; _minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@ -847,7 +845,6 @@ File::File(not_null<Context*> context, not_null<Result*> result)
void File::initDimensions() { void File::initDimensions() {
_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft; _maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
int textWidth = _maxw - (st::inlineFileSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto }; TextParseOptions titleOpts = { 0, _maxw, st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts); _title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
@ -863,7 +860,6 @@ void File::paint(Painter &p, const QRect &clip, const PaintContext *context) con
const auto left = st::inlineFileSize + st::inlineThumbSkip; const auto left = st::inlineFileSize + st::inlineThumbSkip;
ensureDataMediaCreated(); ensureDataMediaCreated();
const auto loaded = _documentMedia->loaded();
const auto displayLoading = _document->displayLoading(); const auto displayLoading = _document->displayLoading();
if (displayLoading) { if (displayLoading) {
ensureAnimation(); ensureAnimation();
@ -1083,11 +1079,9 @@ void Contact::initDimensions() {
int32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip); int32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, textWidth, st::semiboldFont->height, Qt::LayoutDirectionAuto }; TextParseOptions titleOpts = { 0, textWidth, st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts); _title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
int32 titleHeight = qMin(_title.countHeight(textWidth), st::semiboldFont->height);
TextParseOptions descriptionOpts = { TextParseMultiline, textWidth, st::normalFont->height, Qt::LayoutDirectionAuto }; TextParseOptions descriptionOpts = { TextParseMultiline, textWidth, st::normalFont->height, Qt::LayoutDirectionAuto };
_description.setText(st::defaultTextStyle, _result->getLayoutDescription(), descriptionOpts); _description.setText(st::defaultTextStyle, _result->getLayoutDescription(), descriptionOpts);
int32 descriptionHeight = qMin(_description.countHeight(textWidth), st::normalFont->height);
_minh = st::inlineFileSize; _minh = st::inlineFileSize;
_minh += st::inlineRowMargin * 2 + st::inlineRowBorder; _minh += st::inlineRowMargin * 2 + st::inlineRowBorder;
@ -1348,7 +1342,6 @@ void Game::countFrameSize() {
void Game::initDimensions() { void Game::initDimensions() {
_maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft; _maxw = st::emojiPanWidth - st::emojiScroll.width - st::inlineResultsLeft;
int32 textWidth = _maxw - (st::inlineThumbSize + st::inlineThumbSkip);
TextParseOptions titleOpts = { 0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto }; TextParseOptions titleOpts = { 0, _maxw, 2 * st::semiboldFont->height, Qt::LayoutDirectionAuto };
_title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts); _title.setText(st::semiboldTextStyle, TextUtilities::SingleLine(_result->getLayoutTitle()), titleOpts);
int32 titleHeight = qMin(_title.countHeight(_maxw), 2 * st::semiboldFont->height); int32 titleHeight = qMin(_title.countHeight(_maxw), 2 * st::semiboldFont->height);
@ -1390,7 +1383,7 @@ void Game::paint(Painter &p, const QRect &clip, const PaintContext *context) con
if (animatedThumb) { if (animatedThumb) {
_documentMedia->automaticLoad(fileOrigin(), nullptr); _documentMedia->automaticLoad(fileOrigin(), nullptr);
bool loaded = _documentMedia->loaded(), loading = document->loading(), displayLoading = document->displayLoading(); bool loaded = _documentMedia->loaded(), displayLoading = document->displayLoading();
if (loaded && !_gif && !_gif.isBad()) { if (loaded && !_gif && !_gif.isBad()) {
auto that = const_cast<Game*>(this); auto that = const_cast<Game*>(this);
that->_gif = Media::Clip::MakeReader( that->_gif = Media::Clip::MakeReader(

View file

@ -650,7 +650,6 @@ bool Inner::inlineItemVisible(const ItemBase *layout) {
int row = position / MatrixRowShift, col = position % MatrixRowShift; int row = position / MatrixRowShift, col = position % MatrixRowShift;
Assert((row < _rows.size()) && (col < _rows[row].items.size())); Assert((row < _rows.size()) && (col < _rows[row].items.size()));
auto &inlineItems = _rows[row].items;
int top = st::stickerPanPadding; int top = st::stickerPanPadding;
for (int32 i = 0; i < row; ++i) { for (int32 i = 0; i < row; ++i) {
top += _rows.at(i).height; top += _rows.at(i).height;
@ -668,7 +667,6 @@ void Inner::updateSelected() {
return; return;
} }
auto newSelected = -1;
auto p = mapFromGlobal(_lastMousePos); auto p = mapFromGlobal(_lastMousePos);
int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::roundRadiusSmall); int sx = (rtl() ? width() - p.x() : p.x()) - (st::inlineResultsLeft - st::roundRadiusSmall);

View file

@ -173,7 +173,6 @@ QByteArray FileParser::ReadFile(const QString &absolutePath, const QString &rela
file.seek(0); file.seek(0);
QByteArray data; QByteArray data;
int skip = 0;
auto readUtf16Stream = [relativePath, absolutePath](auto &&stream) { auto readUtf16Stream = [relativePath, absolutePath](auto &&stream) {
stream.setCodec("UTF-16"); stream.setCodec("UTF-16");
auto string = stream.readAll(); auto string = stream.readAll();

View file

@ -41,7 +41,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Main { namespace Main {
namespace { namespace {
constexpr auto kLegacyCallsPeerToPeerNobody = 4;
constexpr auto kTmpPasswordReserveTime = TimeId(10); constexpr auto kTmpPasswordReserveTime = TimeId(10);
[[nodiscard]] QString ValidatedInternalLinksDomain( [[nodiscard]] QString ValidatedInternalLinksDomain(

View file

@ -797,10 +797,6 @@ void MainWidget::cacheBackground() {
result.setDevicePixelRatio(cRetinaFactor()); result.setDevicePixelRatio(cRetinaFactor());
{ {
QPainter p(&result); QPainter p(&result);
auto left = 0;
auto top = 0;
auto right = _willCacheFor.width();
auto bottom = _willCacheFor.height();
auto w = bg.width() / cRetinaFactor(); auto w = bg.width() / cRetinaFactor();
auto h = bg.height() / cRetinaFactor(); auto h = bg.height() / cRetinaFactor();
auto sx = 0; auto sx = 0;
@ -1691,7 +1687,6 @@ Window::SectionSlideParams MainWidget::prepareThirdSectionAnimation(Window::Sect
result.withTopBarShadow = false; result.withTopBarShadow = false;
} }
floatPlayerHideAll(); floatPlayerHideAll();
auto sectionTop = getThirdSectionTop();
result.oldContentCache = _thirdSection->grabForShowAnimation(result); result.oldContentCache = _thirdSection->grabForShowAnimation(result);
floatPlayerShowVisible(); floatPlayerShowVisible();
return result; return result;

View file

@ -1601,7 +1601,6 @@ public:
return false; return false;
} }
int res = 0;
char err[AV_ERROR_MAX_STRING_SIZE] = { 0 }; char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
for (int32 i = 0, l = fmtContext->nb_streams; i < l; ++i) { for (int32 i = 0, l = fmtContext->nb_streams; i < l; ++i) {

View file

@ -11,13 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/file_location.h" #include "core/file_location.h"
namespace Media { namespace Media {
namespace {
constexpr AVSampleFormat AudioToFormat = AV_SAMPLE_FMT_S16;
constexpr int64_t AudioToChannelLayout = AV_CH_LAYOUT_STEREO;
constexpr int32 AudioToChannels = 2;
} // namespace
ChildFFMpegLoader::ChildFFMpegLoader( ChildFFMpegLoader::ChildFFMpegLoader(
std::unique_ptr<ExternalSoundData> &&data) std::unique_ptr<ExternalSoundData> &&data)

View file

@ -28,7 +28,6 @@ Type ReadBigEndian(bytes::const_span data) {
} }
bool IsAtom(bytes::const_span header, const char (&atom)[5]) { bool IsAtom(bytes::const_span header, const char (&atom)[5]) {
const auto check = header.subspan(4, 4);
return bytes::compare( return bytes::compare(
header.subspan(4, 4), header.subspan(4, 4),
bytes::make_span(atom).subspan(0, 4)) == 0; bytes::make_span(atom).subspan(0, 4)) == 0;

View file

@ -709,7 +709,6 @@ Manager::ResultHandleState Manager::handleResult(ReaderPrivate *reader, ProcessR
auto it = constUnsafeFindReaderPointer(reader); auto it = constUnsafeFindReaderPointer(reader);
if (it != _readerPointers.cend()) { if (it != _readerPointers.cend()) {
int32 index = 0; int32 index = 0;
Reader *r = it.key();
Reader::Frame *frame = it.key()->frameToWrite(&index); Reader::Frame *frame = it.key()->frameToWrite(&index);
if (frame) { if (frame) {
frame->clear(); frame->clear();

View file

@ -628,7 +628,6 @@ void Instance::playPauseCancelClicked(AudioMsgId::Type type) {
return; return;
} }
const auto state = getState(type); const auto state = getState(type);
const auto stopped = IsStoppedOrStopping(state.state);
const auto showPause = ShowPauseIcon(state.state); const auto showPause = ShowPauseIcon(state.state);
const auto audio = state.id.audio(); const auto audio = state.id.audio();
if (audio && audio->loading() && !data->streamed) { if (audio && audio->loading() && !data->streamed) {

View file

@ -271,10 +271,6 @@ void Widget::handleSeekProgress(float64 progress) {
void Widget::handleSeekFinished(float64 progress) { void Widget::handleSeekFinished(float64 progress) {
if (!_lastDurationMs) return; if (!_lastDurationMs) return;
const auto positionMs = std::clamp(
static_cast<crl::time>(progress * _lastDurationMs),
crl::time(0),
_lastDurationMs);
_seekPositionMs = -1; _seekPositionMs = -1;
instance()->finishSeeking(_type, progress); instance()->finishSeeking(_type, progress);
@ -464,7 +460,6 @@ void Widget::handleSongUpdate(const TrackState &state) {
_playbackProgress->updateState(state); _playbackProgress->updateState(state);
} }
auto stopped = IsStoppedOrStopping(state.state);
auto showPause = ShowPauseIcon(state.state); auto showPause = ShowPauseIcon(state.state);
if (instance()->isSeeking(_type)) { if (instance()->isSeeking(_type)) {
showPause = true; showPause = true;

View file

@ -14,11 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Media { namespace Media {
namespace Streaming { namespace Streaming {
namespace {
constexpr auto kMaxConcurrentRequests = 4;
} // namespace
LoaderMtproto::LoaderMtproto( LoaderMtproto::LoaderMtproto(
not_null<Storage::DownloadManagerMtproto*> owner, not_null<Storage::DownloadManagerMtproto*> owner,

View file

@ -25,7 +25,7 @@ constexpr auto kMsFrequency = 1000; // 1000 ms per second.
// If we played for 3 seconds and got stuck it looks like we're loading // If we played for 3 seconds and got stuck it looks like we're loading
// slower than we're playing, so load full file in that case. // slower than we're playing, so load full file in that case.
constexpr auto kLoadFullIfStuckAfterPlayback = 3 * crl::time(1000); //constexpr auto kLoadFullIfStuckAfterPlayback = 3 * crl::time(1000);
[[nodiscard]] bool FullTrackReceived(const TrackState &state) { [[nodiscard]] bool FullTrackReceived(const TrackState &state) {
return (state.duration != kTimeUnknown) return (state.duration != kTimeUnknown)
@ -348,8 +348,6 @@ void Player::fileWaitingForData() {
bool Player::fileProcessPackets( bool Player::fileProcessPackets(
base::flat_map<int, std::vector<FFmpeg::Packet>> &packets) { base::flat_map<int, std::vector<FFmpeg::Packet>> &packets) {
_waitingForData = false; _waitingForData = false;
auto audioTill = kTimeUnknown;
auto videoTill = kTimeUnknown;
for (auto &[index, list] : packets) { for (auto &[index, list] : packets) {
if (list.empty()) { if (list.empty()) {
continue; continue;

View file

@ -141,8 +141,8 @@ QImage ConvertFrame(
- storage.width(); - storage.width();
const auto deltaFrom = (frame->linesize[0] / sizeof(uint32)) const auto deltaFrom = (frame->linesize[0] / sizeof(uint32))
- frame->width; - frame->width;
for (const auto y : ranges::views::ints(0, frame->height)) { for ([[maybe_unused]] const auto y : ranges::views::ints(0, frame->height)) {
for (const auto x : ranges::views::ints(0, frame->width)) { for ([[maybe_unused]] const auto x : ranges::views::ints(0, frame->width)) {
// Wipe out possible alpha values. // Wipe out possible alpha values.
*to++ = 0xFF000000U | *from++; *to++ = 0xFF000000U | *from++;
} }

View file

@ -32,7 +32,6 @@ static_assert(kDisplaySkipped != kTimeUnknown);
//} //}
auto result = FFmpeg::CreateFrameStorage(data.size); auto result = FFmpeg::CreateFrameStorage(data.size);
const auto format = AV_PIX_FMT_BGRA;
const auto swscale = FFmpeg::MakeSwscalePointer( const auto swscale = FFmpeg::MakeSwscalePointer(
data.size, data.size,
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,

View file

@ -1076,7 +1076,6 @@ void OverlayWidget::resizeContentByScreenSize() {
: (_streamed->controls.y() : (_streamed->controls.y()
- st::mediaviewCaptionPadding.bottom() - st::mediaviewCaptionPadding.bottom()
- st::mediaviewCaptionMargin.height()); - st::mediaviewCaptionMargin.height());
const auto skipWidth = 0;
const auto skipHeight = (height() - bottom); const auto skipHeight = (height() - bottom);
const auto availableWidth = width(); const auto availableWidth = width();
const auto availableHeight = height() - 2 * skipHeight; const auto availableHeight = height() - 2 * skipHeight;
@ -2030,15 +2029,6 @@ bool OverlayWidget::validCollage() const {
if (!_collage) { if (!_collage) {
return false; return false;
} }
const auto countDistanceInData = [](const auto &a, const auto &b) {
return [&](const WebPageCollage &data) {
const auto i = ranges::find(data.items, a);
const auto j = ranges::find(data.items, b);
return (i != end(data.items) && j != end(data.items))
? std::make_optional(i - j)
: std::nullopt;
};
};
if (key == _collage->key) { if (key == _collage->key) {
return true; return true;
@ -2113,12 +2103,6 @@ void OverlayWidget::refreshCaption(HistoryItem *item) {
if (caption.text.isEmpty()) { if (caption.text.isEmpty()) {
return; return;
} }
const auto asBot = [&] {
if (const auto author = item->author()->asUser()) {
return author->isBot();
}
return false;
}();
using namespace HistoryView; using namespace HistoryView;
_caption = Ui::Text::String(st::msgMinWidth); _caption = Ui::Text::String(st::msgMinWidth);

View file

@ -44,7 +44,6 @@ namespace View {
namespace { namespace {
constexpr auto kPipLoaderPriority = 2; constexpr auto kPipLoaderPriority = 2;
constexpr auto kSaveGeometryTimeout = crl::time(1000);
constexpr auto kMsInSecond = 1000; constexpr auto kMsInSecond = 1000;
[[nodiscard]] bool IsWindowControlsOnLeft() { [[nodiscard]] bool IsWindowControlsOnLeft() {
@ -1515,7 +1514,7 @@ void Pip::updatePlaybackState() {
} }
_playbackProgress->updateState(state); _playbackProgress->updateState(state);
qint64 position = 0, length = state.length; qint64 position = 0;
if (Player::IsStoppedAtEnd(state.state)) { if (Player::IsStoppedAtEnd(state.state)) {
position = state.length; position = state.length;
} else if (!Player::IsStoppedOrStopping(state.state)) { } else if (!Player::IsStoppedOrStopping(state.state)) {

View file

@ -205,7 +205,6 @@ void Pip::RendererSW::paintTransformedImage(
const auto rect = geometry.inner; const auto rect = geometry.inner;
const auto rotation = geometry.rotation; const auto rotation = geometry.rotation;
if (geometry.useTransparency) { if (geometry.useTransparency) {
const auto sides = RectPart::AllSides & ~geometry.attached;
Ui::Shadow::paint(*_p, rect, geometry.outer.width(), st::callShadow); Ui::Shadow::paint(*_p, rect, geometry.outer.width(), st::callShadow);
} }

Some files were not shown because too many files have changed in this diff Show more