mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Fix build with GCC.
This commit is contained in:
parent
45cacc94c0
commit
fdf4129e5e
28 changed files with 28 additions and 64 deletions
|
@ -3487,7 +3487,6 @@ void ApiWrap::sendMessage(MessageToSend &&message) {
|
|||
HistoryItem *lastMessage = nullptr;
|
||||
|
||||
auto &histories = history->owner().histories();
|
||||
const auto requestType = Data::Histories::RequestType::Send;
|
||||
|
||||
while (TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
||||
auto newId = FullMsgId(
|
||||
|
|
|
@ -261,9 +261,7 @@ struct IconSelector {
|
|||
selector->provideRecent(recent());
|
||||
}, selector->lifetime());
|
||||
|
||||
auto ownedFooter = selector->createFooter();
|
||||
const auto footer = ownedFooter.data();
|
||||
placeFooter(std::move(ownedFooter));
|
||||
placeFooter(selector->createFooter());
|
||||
|
||||
const auto shadow = Ui::CreateChild<Ui::PlainShadow>(box.get());
|
||||
shadow->show();
|
||||
|
|
|
@ -1186,7 +1186,6 @@ object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
|||
} else {
|
||||
comment.text = link;
|
||||
}
|
||||
const auto owner = &peer->owner();
|
||||
auto &api = peer->session().api();
|
||||
for (const auto thread : result) {
|
||||
auto message = Api::MessageToSend(
|
||||
|
|
|
@ -1125,16 +1125,7 @@ void ShareBox::Inner::chooseForumTopic(not_null<Data::Forum*> forum) {
|
|||
updateChatName(chat);
|
||||
changePeerCheckState(chat, true);
|
||||
};
|
||||
auto initBox = [](not_null<PeerListBox*> box) {
|
||||
box->addButton(tr::lng_cancel(), [box] {
|
||||
box->closeBox();
|
||||
});
|
||||
};
|
||||
auto box = Box<PeerListBox>(
|
||||
std::make_unique<ChooseTopicBoxController>(
|
||||
forum,
|
||||
std::move(chosen)),
|
||||
[=](not_null<PeerListBox*> box) {
|
||||
auto initBox = [=](not_null<PeerListBox*> box) {
|
||||
box->addButton(tr::lng_cancel(), [=] {
|
||||
box->closeBox();
|
||||
});
|
||||
|
@ -1143,7 +1134,12 @@ void ShareBox::Inner::chooseForumTopic(not_null<Data::Forum*> forum) {
|
|||
) | rpl::start_with_next([=] {
|
||||
box->closeBox();
|
||||
}, box->lifetime());
|
||||
});
|
||||
};
|
||||
auto box = Box<PeerListBox>(
|
||||
std::make_unique<ChooseTopicBoxController>(
|
||||
forum,
|
||||
std::move(chosen)),
|
||||
std::move(initBox));
|
||||
*weak = box.data();
|
||||
_show->showBox(std::move(box));
|
||||
}
|
||||
|
|
|
@ -180,7 +180,6 @@ object_ptr<ShareBox> ShareInviteLinkBox(
|
|||
} else {
|
||||
comment.text = link;
|
||||
}
|
||||
const auto owner = &peer->owner();
|
||||
auto &api = peer->session().api();
|
||||
for (const auto thread : result) {
|
||||
auto message = Api::MessageToSend(
|
||||
|
|
|
@ -141,7 +141,7 @@ void BotKeyboard::paintEvent(QPaintEvent *e) {
|
|||
_impl->paint(
|
||||
p,
|
||||
nullptr,
|
||||
{},
|
||||
Ui::BubbleRounding(),
|
||||
width(),
|
||||
clip.translated(-x, -st::botKbScroll.deltat));
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ void BotKeyboard::clickHandlerActiveChanged(const ClickHandlerPtr &p, bool activ
|
|||
|
||||
void BotKeyboard::clickHandlerPressedChanged(const ClickHandlerPtr &p, bool pressed) {
|
||||
if (!_impl) return;
|
||||
_impl->clickHandlerPressedChanged(p, pressed, {});
|
||||
_impl->clickHandlerPressedChanged(p, pressed, Ui::BubbleRounding());
|
||||
}
|
||||
|
||||
bool BotKeyboard::updateMarkup(HistoryItem *to, bool force) {
|
||||
|
|
|
@ -450,9 +450,7 @@ void ForumTopic::setLastMessage(HistoryItem *item) {
|
|||
void ForumTopic::setChatListMessage(HistoryItem *item) {
|
||||
if (_chatListMessage && *_chatListMessage == item) {
|
||||
return;
|
||||
}
|
||||
const auto was = _chatListMessage.value_or(nullptr);
|
||||
if (item) {
|
||||
} else if (item) {
|
||||
if (item->isSponsored()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -151,7 +151,6 @@ void Groups::refreshViews(const HistoryItemsList &items) {
|
|||
if (items.empty()) {
|
||||
return;
|
||||
}
|
||||
const auto history = items.front()->history();
|
||||
for (const auto &item : items) {
|
||||
_data->requestItemViewRefresh(item);
|
||||
item->invalidateChatListEntry();
|
||||
|
|
|
@ -962,7 +962,6 @@ void Histories::checkTopicCreated(FullMsgId rootId, MsgId realRoot) {
|
|||
std::move(entry.done),
|
||||
std::move(entry.fail));
|
||||
}
|
||||
const auto topic = history->peer->forumTopicFor(realRoot);
|
||||
for (const auto &item : history->clientSideMessages()) {
|
||||
const auto replace = [&](MsgId nowId) {
|
||||
return (nowId == rootId.msg) ? realRoot : nowId;
|
||||
|
|
|
@ -953,7 +953,6 @@ void Widget::jumpToTop(bool belowPinned) {
|
|||
controller()->activeChatsFilterCurrent())
|
||||
: session().data().chatsList(_openedFolder);
|
||||
const auto count = int(list->pinned()->order().size());
|
||||
const auto now = _scroll->scrollTop();
|
||||
const auto row = _inner->st()->height;
|
||||
const auto min = (row * (count * 2 + 1) - _scroll->height()) / 2;
|
||||
if (_scroll->scrollTop() <= min) {
|
||||
|
@ -1573,8 +1572,6 @@ void Widget::searchReceived(
|
|||
_lastSearchPeer = nullptr;
|
||||
_lastSearchId = _lastSearchMigratedId = 0;
|
||||
}
|
||||
const auto isGlobalSearch = (type == SearchRequestType::FromStart)
|
||||
|| (type == SearchRequestType::FromOffset);
|
||||
const auto isMigratedSearch = (type == SearchRequestType::MigratedFromStart)
|
||||
|| (type == SearchRequestType::MigratedFromOffset);
|
||||
const auto process = [&](const MTPVector<MTPMessage> &messages) {
|
||||
|
|
|
@ -112,7 +112,6 @@ void ForwardPanel::updateTexts() {
|
|||
_text.clear();
|
||||
return;
|
||||
}
|
||||
int32 version = 0;
|
||||
QString from;
|
||||
TextWithEntities text;
|
||||
const auto keepNames = (_data.options
|
||||
|
|
|
@ -651,8 +651,6 @@ void ListWidget::showAtPosition(
|
|||
anim::type animated,
|
||||
Fn<void(bool found)> done) {
|
||||
const auto showAtUnread = (position == Data::UnreadMessagePosition);
|
||||
const auto showAtStart = (position == Data::MinMessagePosition);
|
||||
const auto showAtEnd = (position == Data::MaxMessagePosition);
|
||||
|
||||
if (showAtUnread && jumpToBottomInsteadOfUnread()) {
|
||||
showAtPosition(Data::MaxMessagePosition, animated, std::move(done));
|
||||
|
|
|
@ -3133,7 +3133,7 @@ Ui::BubbleRounding Message::countMessageRounding() const {
|
|||
|| (context() == Context::Replies && data()->isDiscussionPost());
|
||||
const auto right = !delegate()->elementIsChatWide() && hasOutLayout();
|
||||
using Corner = Ui::BubbleCornerRounding;
|
||||
return {
|
||||
return Ui::BubbleRounding{
|
||||
.topLeft = (smallTop && !right) ? Corner::Small : Corner::Large,
|
||||
.topRight = (smallTop && right) ? Corner::Small : Corner::Large,
|
||||
.bottomLeft = ((smallBottom && !right)
|
||||
|
|
|
@ -1934,7 +1934,6 @@ bool RepliesWidget::showMessage(
|
|||
if (!message) {
|
||||
return false;
|
||||
}
|
||||
auto originFound = false;
|
||||
const auto originMessage = [&]() -> HistoryItem* {
|
||||
using OriginMessage = Window::SectionShow::OriginMessage;
|
||||
if (const auto origin = std::get_if<OriginMessage>(¶ms.origin)) {
|
||||
|
|
|
@ -760,7 +760,7 @@ Ui::BubbleRounding Document::thumbRounding(
|
|||
Ui::BubbleRounding outsideRounding) const {
|
||||
using Corner = Ui::BubbleCornerRounding;
|
||||
if (mode != LayoutMode::Grouped && _parent->media() != this) {
|
||||
return {}; // In a WebPage preview.
|
||||
return Ui::BubbleRounding(); // In a WebPage preview.
|
||||
}
|
||||
const auto hasCaption = Has<HistoryDocumentCaptioned>();
|
||||
const auto adjust = [&](Corner already, bool skip = false) {
|
||||
|
|
|
@ -195,8 +195,6 @@ int ExtendedPreview::minWidthForButton() const {
|
|||
void ExtendedPreview::draw(Painter &p, const PaintContext &context) const {
|
||||
if (width() < st::msgPadding.left() + st::msgPadding.right() + 1) return;
|
||||
|
||||
const auto st = context.st;
|
||||
const auto sti = context.imageStyle();
|
||||
const auto stm = context.messageStyle();
|
||||
auto paintx = 0, painty = 0, paintw = width(), painth = height();
|
||||
auto bubble = _parent->hasBubble();
|
||||
|
|
|
@ -1110,8 +1110,6 @@ void Gif::drawGrouped(
|
|||
const auto radial = isRadialAnimation()
|
||||
|| (streamedForWaiting && streamedForWaiting->waitingShown());
|
||||
|
||||
const auto roundRadius = ImageRoundRadius::Large;
|
||||
|
||||
if (streamed) {
|
||||
const auto original = sizeForAspectRatio();
|
||||
const auto originalWidth = style::ConvertScale(original.width());
|
||||
|
|
|
@ -160,7 +160,6 @@ void Location::draw(Painter &p, const PaintContext &context) const {
|
|||
auto paintx = 0, painty = 0, paintw = width(), painth = height();
|
||||
bool bubble = _parent->hasBubble();
|
||||
const auto st = context.st;
|
||||
const auto sti = context.imageStyle();
|
||||
const auto stm = context.messageStyle();
|
||||
|
||||
const auto hasText = !_title.isEmpty() || !_description.isEmpty();
|
||||
|
|
|
@ -582,7 +582,6 @@ void Photo::drawGrouped(
|
|||
: highlightOpacity;
|
||||
if (overlayOpacity > 0.) {
|
||||
p.setOpacity(overlayOpacity);
|
||||
const auto roundRadius = ImageRoundRadius::Large;
|
||||
fillImageOverlay(p, geometry, rounding, context);
|
||||
if (!context.selected()) {
|
||||
fillImageOverlay(p, geometry, rounding, context);
|
||||
|
|
|
@ -176,8 +176,6 @@ void ThemeDocument::draw(Painter &p, const PaintContext &context) const {
|
|||
const auto radial = isRadialAnimation();
|
||||
|
||||
auto rthumb = style::rtlrect(paintx, painty, paintw, painth, width());
|
||||
auto roundRadius = ImageRoundRadius::Small;
|
||||
auto roundCorners = RectPart::AllCorners;
|
||||
validateThumbnail();
|
||||
p.drawPixmap(rthumb.topLeft(), _thumbnail);
|
||||
if (context.selected()) {
|
||||
|
|
|
@ -210,7 +210,6 @@ void Controller::setupMigrationViewer() {
|
|||
|
||||
void Controller::replaceWith(std::shared_ptr<Memento> memento) {
|
||||
const auto window = parentController();
|
||||
const auto section = _section;
|
||||
auto params = Window::SectionShow(
|
||||
Window::SectionShow::Way::Backward,
|
||||
anim::type::instant,
|
||||
|
|
|
@ -516,7 +516,6 @@ bool MainWidget::setForwardDraft(
|
|||
not_null<Data::Thread*> thread,
|
||||
Data::ForwardDraft &&draft) {
|
||||
const auto history = thread->owningHistory();
|
||||
const auto peer = history->peer;
|
||||
const auto items = session().data().idsToItems(draft.ids);
|
||||
const auto topicRootId = thread->topicRootId();
|
||||
const auto error = GetErrorTextForSending(
|
||||
|
|
|
@ -787,6 +787,7 @@ public:
|
|||
|
||||
void showNotification(
|
||||
not_null<PeerData*> peer,
|
||||
MsgId topicRootId,
|
||||
std::shared_ptr<Data::CloudImageView> &userpicView,
|
||||
MsgId msgId,
|
||||
const QString &title,
|
||||
|
@ -1061,6 +1062,7 @@ Manager::~Manager() = default;
|
|||
|
||||
void Manager::doShowNativeNotification(
|
||||
not_null<PeerData*> peer,
|
||||
MsgId topicRootId,
|
||||
std::shared_ptr<Data::CloudImageView> &userpicView,
|
||||
MsgId msgId,
|
||||
const QString &title,
|
||||
|
@ -1069,6 +1071,7 @@ void Manager::doShowNativeNotification(
|
|||
DisplayOptions options) {
|
||||
_private->showNotification(
|
||||
peer,
|
||||
topicRootId,
|
||||
userpicView,
|
||||
msgId,
|
||||
title,
|
||||
|
|
|
@ -21,6 +21,7 @@ public:
|
|||
protected:
|
||||
void doShowNativeNotification(
|
||||
not_null<PeerData*> peer,
|
||||
MsgId topicRootId,
|
||||
std::shared_ptr<Data::CloudImageView> &userpicView,
|
||||
MsgId msgId,
|
||||
const QString &title,
|
||||
|
|
|
@ -514,7 +514,6 @@ void LayerWidget::paintEvent(QPaintEvent *e) {
|
|||
|
||||
auto clip = e->rect();
|
||||
auto r = st::boxRadius;
|
||||
auto parts = RectPart::None | 0;
|
||||
const auto &pixmaps = Ui::CachedCornerPixmaps(Ui::BoxCorners);
|
||||
if (!_tillTop && clip.intersects({ 0, 0, width(), r })) {
|
||||
Ui::FillRoundRect(p, 0, 0, width(), r, st::boxBg, {
|
||||
|
|
|
@ -238,7 +238,6 @@ void PaintSolidBubble(QPainter &p, const SimpleBubble &args) {
|
|||
auto &corners = (size == Corner::Large)
|
||||
? st.msgBgCornersLarge
|
||||
: st.msgBgCornersSmall;
|
||||
const auto &corner = corners.p[index];
|
||||
p.drawPixmap(x, y, corners.p[index]);
|
||||
}, [&](const QPoint &bottomPosition) {
|
||||
tail.paint(p, bottomPosition - tailShift, args.outerWidth);
|
||||
|
@ -341,15 +340,12 @@ void PaintBubble(QPainter &p, const ComplexBubble &args) {
|
|||
auto from = top;
|
||||
for (const auto &selected : args.selection) {
|
||||
if (selected.top > from) {
|
||||
const auto fromTop = (from <= top);
|
||||
paintOne(
|
||||
QRect(left, from, width, selected.top - from),
|
||||
false,
|
||||
(from <= top),
|
||||
false);
|
||||
}
|
||||
const auto fromTop = (selected.top <= top);
|
||||
const auto tillBottom = (selected.top + selected.height >= bottom);
|
||||
paintOne(
|
||||
QRect(left, selected.top, width, selected.height),
|
||||
true,
|
||||
|
|
|
@ -485,7 +485,6 @@ void Filler::addTogglePin() {
|
|||
}
|
||||
const auto controller = _controller;
|
||||
const auto filterId = _request.filterId;
|
||||
const auto peer = _peer;
|
||||
const auto thread = _request.key.thread();
|
||||
if (!thread || thread->fixedOnTopIndex()) {
|
||||
return;
|
||||
|
@ -501,7 +500,7 @@ void Filler::addTogglePin() {
|
|||
TogglePinnedThread(controller, strong, filterId);
|
||||
}
|
||||
};
|
||||
const auto pinAction = _addAction(
|
||||
_addAction(
|
||||
pinText(),
|
||||
pinToggle,
|
||||
(thread->isPinnedDialog(filterId)
|
||||
|
@ -1684,16 +1683,7 @@ QPointer<Ui::BoxContent> ShowDropMediaBox(
|
|||
callback();
|
||||
}
|
||||
};
|
||||
auto initBox = [](not_null<PeerListBox*> box) {
|
||||
box->addButton(tr::lng_cancel(), [box] {
|
||||
box->closeBox();
|
||||
});
|
||||
};
|
||||
*weak = navigation->parentController()->show(Box<PeerListBox>(
|
||||
std::make_unique<ChooseTopicBoxController>(
|
||||
forum,
|
||||
std::move(chosen)),
|
||||
[=](not_null<PeerListBox*> box) {
|
||||
auto initBox = [=](not_null<PeerListBox*> box) {
|
||||
box->addButton(tr::lng_cancel(), [=] {
|
||||
box->closeBox();
|
||||
});
|
||||
|
@ -1702,7 +1692,12 @@ QPointer<Ui::BoxContent> ShowDropMediaBox(
|
|||
) | rpl::start_with_next([=] {
|
||||
box->closeBox();
|
||||
}, box->lifetime());
|
||||
}));
|
||||
};
|
||||
*weak = navigation->parentController()->show(Box<PeerListBox>(
|
||||
std::make_unique<ChooseTopicBoxController>(
|
||||
forum,
|
||||
std::move(chosen)),
|
||||
std::move(initBox)));
|
||||
return weak->data();
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 6e923872a4b66767da93f7e388f9fcedf266e1aa
|
||||
Subproject commit 7faff81653264b1cb9cfafeae04cdab82e21117d
|
Loading…
Add table
Reference in a new issue