Fix build with GCC.

This commit is contained in:
John Preston 2023-07-11 22:22:40 +04:00
parent f7cbac1f46
commit 6607848abc
13 changed files with 2 additions and 29 deletions

View file

@ -1194,7 +1194,6 @@ bool MessageReactions::change(
} }
} }
} }
const auto selfId = owner.session().userPeerId();
auto parsed = base::flat_map<ReactionId, std::vector<RecentReaction>>(); auto parsed = base::flat_map<ReactionId, std::vector<RecentReaction>>();
for (const auto &reaction : recent) { for (const auto &reaction : recent) {
reaction.match([&](const MTPDmessagePeerReaction &data) { reaction.match([&](const MTPDmessagePeerReaction &data) {

View file

@ -132,9 +132,6 @@ bool PollData::applyResults(const MTPPollResults &results) {
} }
} }
if (const auto recent = results.vrecent_voters()) { if (const auto recent = results.vrecent_voters()) {
const auto bareProj = [](not_null<UserData*> user) {
return peerToUser(user->id).bare;
};
const auto recentChanged = !ranges::equal( const auto recentChanged = !ranges::equal(
recentVoters, recentVoters,
recent->v, recent->v,

View file

@ -273,7 +273,6 @@ void Stories::parseAndApply(const MTPUserStories &stories) {
const auto &data = stories.data(); const auto &data = stories.data();
const auto peerId = peerFromUser(data.vuser_id()); const auto peerId = peerFromUser(data.vuser_id());
const auto readTill = data.vmax_read_id().value_or_empty(); const auto readTill = data.vmax_read_id().value_or_empty();
const auto count = int(data.vstories().v.size());
const auto user = _owner->peer(peerId)->asUser(); const auto user = _owner->peer(peerId)->asUser();
auto result = StoriesSource{ auto result = StoriesSource{
.user = user, .user = user,
@ -355,7 +354,6 @@ Story *Stories::parseAndApply(
if (i != end(stories)) { if (i != end(stories)) {
const auto result = i->second.get(); const auto result = i->second.get();
const auto mediaChanged = (result->media() != *media); const auto mediaChanged = (result->media() != *media);
const auto pinned = result->pinned();
result->applyChanges(*media, data, now); result->applyChanges(*media, data, now);
const auto j = _pollingSettings.find(result); const auto j = _pollingSettings.find(result);
if (j != end(_pollingSettings)) { if (j != end(_pollingSettings)) {
@ -577,7 +575,7 @@ void Stories::sendResolveRequests() {
finish(peerId); finish(peerId);
continue; continue;
} }
const auto requestId = api->request(MTPstories_GetStoriesByID( api->request(MTPstories_GetStoriesByID(
user->inputUser, user->inputUser,
MTP_vector<MTPint>(prepared) MTP_vector<MTPint>(prepared)
)).done([=](const MTPstories_Stories &result) { )).done([=](const MTPstories_Stories &result) {
@ -1083,7 +1081,6 @@ void Stories::sendIncrementViewsRequests() {
return; return;
} }
auto ids = QVector<MTPint>(); auto ids = QVector<MTPint>();
auto peer = PeerId();
struct Prepared { struct Prepared {
PeerId peer = 0; PeerId peer = 0;
QVector<MTPint> ids; QVector<MTPint> ids;
@ -1141,7 +1138,7 @@ void Stories::loadViewsSlice(
MTP_int(id), MTP_int(id),
MTP_int(offset ? offset->date : 0), MTP_int(offset ? offset->date : 0),
MTP_long(offset ? peerToUser(offset->peer->id).bare : 0), MTP_long(offset ? peerToUser(offset->peer->id).bare : 0),
MTP_int(kViewsPerPage) MTP_int(perPage)
)).done([=](const MTPstories_StoryViewsList &result) { )).done([=](const MTPstories_StoryViewsList &result) {
_viewsRequestId = 0; _viewsRequestId = 0;
@ -1595,7 +1592,6 @@ void Stories::sendPollingViewsRequests() {
return; return;
} else if (!_viewsRequestId) { } else if (!_viewsRequestId) {
Assert(_viewsDone == nullptr); Assert(_viewsDone == nullptr);
const auto one = _pollingViews.front();
loadViewsSlice(_pollingViews.front()->id(), std::nullopt, nullptr); loadViewsSlice(_pollingViews.front()->id(), std::nullopt, nullptr);
} }
_pollingViewsTimer.callOnce(kPollViewsInterval); _pollingViewsTimer.callOnce(kPollViewsInterval);

View file

@ -104,7 +104,6 @@ bool StoryPreload::LoadTask::feedPart(
Expects(bytes.size() <= Storage::kDownloadPartSize); Expects(bytes.size() <= Storage::kDownloadPartSize);
const auto part = Storage::kDownloadPartSize; const auto part = Storage::kDownloadPartSize;
const auto index = offset / part;
_requestedOffsets.remove(int(offset)); _requestedOffsets.remove(int(offset));
_parts[offset] = bytes; _parts[offset] = bytes;
if ((_nextRequestOffset + part >= _parts.size() * part) if ((_nextRequestOffset + part >= _parts.size() * part)

View file

@ -761,7 +761,6 @@ void List::updateSelected() {
return; return;
} }
const auto &st = _st.small; const auto &st = _st.small;
const auto &full = _st.full;
const auto p = mapFromGlobal(_lastMousePosition); const auto p = mapFromGlobal(_lastMousePosition);
const auto layout = computeLayout(); const auto layout = computeLayout();
const auto firstRightFull = layout.leftFull const auto firstRightFull = layout.leftFull

View file

@ -623,7 +623,6 @@ StoriesSlice ParseStoriesSlice(
++result.skipped; ++result.skipped;
story.match([&](const MTPDstoryItem &data) { story.match([&](const MTPDstoryItem &data) {
const auto date = data.vdate().v; const auto date = data.vdate().v;
const auto expires = data.vexpire_date().v;
auto media = Media(); auto media = Media();
data.vmedia().match([&](const MTPDmessageMediaPhoto &data) { data.vmedia().match([&](const MTPDmessageMediaPhoto &data) {
const auto suggestedPath = "stories/" const auto suggestedPath = "stories/"

View file

@ -1219,7 +1219,6 @@ void ListWidget::toggleStoryPin(
confirmed(); confirmed();
} }
}; };
const auto session = &_controller->session();
const auto onePhrase = pin const auto onePhrase = pin
? tr::lng_stories_save_sure ? tr::lng_stories_save_sure
: tr::lng_stories_archive_sure; : tr::lng_stories_archive_sure;

View file

@ -454,7 +454,6 @@ void Controller::initLayout() {
const auto nameBoundingRect = [&](QRect geometry, bool left) { const auto nameBoundingRect = [&](QRect geometry, bool left) {
const auto skipSmall = nameFontSize; const auto skipSmall = nameFontSize;
const auto skipBig = skipSmall - std::min(xLeft, 0); const auto skipBig = skipSmall - std::min(xLeft, 0);
const auto top = userpic(geometry).y() + innerHeight;
return QRect( return QRect(
left ? skipBig : skipSmall, left ? skipBig : skipSmall,
(geometry.height() - innerHeight) / 2, (geometry.height() - innerHeight) / 2,

View file

@ -131,7 +131,6 @@ void Reactions::create() {
} }
}, _parent->lifetime()); }, _parent->lifetime());
const auto withSearch = reactions.customAllowed;
_selector = std::make_unique<HistoryView::Reactions::Selector>( _selector = std::make_unique<HistoryView::Reactions::Selector>(
_parent.get(), _parent.get(),
st::storiesReactionsPan, st::storiesReactionsPan,

View file

@ -105,12 +105,8 @@ namespace Media::Stories {
return; return;
} }
const auto generateRandom = [&] {
return base::RandomValue<MTPlong>();
};
const auto api = &story->owner().session().api(); const auto api = &story->owner().session().api();
auto &histories = story->owner().histories(); auto &histories = story->owner().histories();
const auto requestType = Data::Histories::RequestType::Send;
for (const auto thread : result) { for (const auto thread : result) {
const auto action = Api::SendAction(thread, options); const auto action = Api::SendAction(thread, options);
if (!comment.text.isEmpty()) { if (!comment.text.isEmpty()) {
@ -119,11 +115,6 @@ namespace Media::Stories {
message.action.clearDraft = false; message.action.clearDraft = false;
api->sendMessage(std::move(message)); api->sendMessage(std::move(message));
} }
const auto topicRootId = thread->topicRootId();
const auto kGeneralId = Data::ForumTopic::kGeneralId;
const auto topMsgId = (topicRootId == kGeneralId)
? MsgId(0)
: topicRootId;
const auto peer = thread->peer(); const auto peer = thread->peer();
const auto threadHistory = thread->owningHistory(); const auto threadHistory = thread->owningHistory();
const auto randomId = base::RandomValue<uint64>(); const auto randomId = base::RandomValue<uint64>();
@ -131,7 +122,6 @@ namespace Media::Stories {
if (action.replyTo) { if (action.replyTo) {
sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to; sendFlags |= MTPmessages_SendMedia::Flag::f_reply_to;
} }
const auto anonymousPost = peer->amAnonymous();
const auto silentPost = ShouldSendSilent(peer, action.options); const auto silentPost = ShouldSendSilent(peer, action.options);
if (silentPost) { if (silentPost) {
sendFlags |= MTPmessages_SendMedia::Flag::f_silent; sendFlags |= MTPmessages_SendMedia::Flag::f_silent;

View file

@ -252,7 +252,6 @@ void Sibling::checkStory() {
return; return;
} }
const auto story = *maybeStory; const auto story = *maybeStory;
const auto &data = story->media().data;
const auto origin = Data::FileOrigin(); const auto origin = Data::FileOrigin();
v::match(story->media().data, [&](not_null<PhotoData*> photo) { v::match(story->media().data, [&](not_null<PhotoData*> photo) {
_loader = std::make_unique<LoaderPhoto>(photo, origin, [=] { _loader = std::make_unique<LoaderPhoto>(photo, origin, [=] {

View file

@ -673,7 +673,6 @@ void OverlayWidget::showSaveMsgToastWith(
+ st::mediaviewSaveMsgPadding.top() + st::mediaviewSaveMsgPadding.top()
+ st::mediaviewSaveMsgPadding.bottom(); + st::mediaviewSaveMsgPadding.bottom();
_saveMsg = QRect((width() - w) / 2, (height() - h) / 2, w, h); _saveMsg = QRect((width() - w) / 2, (height() - h) / 2, w, h);
const auto toIn = 1.;
const auto callback = [=](float64 value) { const auto callback = [=](float64 value) {
updateSaveMsg(); updateSaveMsg();
if (!_saveMsgAnimation.animating()) { if (!_saveMsgAnimation.animating()) {

View file

@ -517,7 +517,6 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const
if ((blurred || thumbnail || good) if ((blurred || thumbnail || good)
&& ((_pix.width() != _width * cIntRetinaFactor()) && ((_pix.width() != _width * cIntRetinaFactor())
|| (_pixBlurred && (thumbnail || good)))) { || (_pixBlurred && (thumbnail || good)))) {
auto size = _width * cIntRetinaFactor();
auto img = good auto img = good
? good->original() ? good->original()
: thumbnail : thumbnail