fix: crash in server read

This commit is contained in:
ZavaruKitsu 2023-12-12 15:26:33 +03:00
parent 084967354b
commit a98e92639c
4 changed files with 13 additions and 9 deletions

View file

@ -18,7 +18,7 @@
namespace AyuUi
{
ConfirmationBox::ConfirmationBox(
ServerReadConfirmationBox::ServerReadConfirmationBox(
QWidget *,
not_null<Window::SessionController *> controller)
: _controller(controller)
@ -26,7 +26,7 @@ ConfirmationBox::ConfirmationBox(
//
}
void ConfirmationBox::prepare()
void ServerReadConfirmationBox::prepare()
{
_text.create(this, tr::ayu_ReadConfirmationBoxQuestion(), st::boxLabel);
@ -45,7 +45,7 @@ void ConfirmationBox::prepare()
{ closeBox(); });
}
void ConfirmationBox::resizeEvent(QResizeEvent *e)
void ServerReadConfirmationBox::resizeEvent(QResizeEvent *e)
{
BoxContent::resizeEvent(e);
@ -53,7 +53,7 @@ void ConfirmationBox::resizeEvent(QResizeEvent *e)
_text->moveToLeft(padding.left(), padding.top());
}
void ConfirmationBox::ReadAllPeers()
void ServerReadConfirmationBox::ReadAllPeers()
{
auto settings = &AyuSettings::getInstance();
auto prev = settings->sendReadMessages;

View file

@ -12,10 +12,10 @@
namespace AyuUi
{
class ConfirmationBox : public Ui::BoxContent
class ServerReadConfirmationBox : public Ui::BoxContent
{
public:
ConfirmationBox(QWidget *, not_null<Window::SessionController *> controller);
ServerReadConfirmationBox(QWidget *, not_null<Window::SessionController *> controller);
protected:
void prepare() override;

View file

@ -623,8 +623,12 @@ void Histories::sendReadRequest(not_null<History*> history, State &state) {
DEBUG_LOG(("Reading: sending request invoked with till %1."
).arg(tillId.bare));
const auto finished = [=] {
const auto state = lookup(history);
Assert(state != nullptr);
auto state = lookup(history);
// Assert(state != nullptr);
if (state == nullptr) {
// dont care + didnt ask + cry about it + who asked + stay mad + get real + L + bleed + mald seethe cope harder + dilate + incorrect + hoes mad + pound sand + basic skill issue + typo + ratio + ur dad left + you fell off + no u + the audacity + triggered + repelled + ur a minor + k. + any askers + get a life + ok and? + cringe + copium + go outside + touch grass + kick rocks + quote tweet + think again + not based + not funny didnt laugh + social credits -999, 999, 999, 999 + get good + reported + ad hominem + ok boomer + small pp + ur allergic to sunlight + GG! + get rekt + trolled + your loss + muted + banned + kicked + permaban + useless + i slept with ur mom + yo momma + yo momma so fat + redpilled + no bitches allowed + i said it better + tiktok fan + get a life + unsubscribed + plundered + go tell reddit + donowalled + simp + get sticked bug LOL + talk nonsense + trump supporter + yourre a full time discord mod + youre* + grammar issue + nerd + get clapped + kys + lorem ipsum dolor sit amet + go outside + bleach + lol + gay + retard + autistic + reported + ask deez + ez clap + straight cash + idgaf + ratio again + stay mad + read FAQ + youre lost + you “re” + stay pressed + reverse double take back + pedophile + cancelled + done for + don't give a damn + get a job + sus + baka + sussy baka + get blocked + mad free + freer than air + furry + rip bozo + you're a (insert stereotype) + slight_smile + aired + cringe again + Super Idol的笑容 + mad cuz bad + my pronouns are xe, xem & xyr + irrelevant + deal with it + screencapped your bio + karen/kyle + jealous + you're deaf + balls + i'll be right back + go ahead whine about it + not straight + eat paper + you lose + count to three + your problem + no one cares + log off + don't care even more + sex offender + sex defender + get religion + not okay + glhf + NFT owner + you make bad memes + problematic + fall in line + dog water + you look like a wall + you dont know 2 + 2 with yo head ass + you are going to my cringe compilation + you cant count to five + try again + you failed kindergarten + rickrolled + no lifer + guten freunden schickt man einen deutschen panzer + you have a anime profile picture + an* + fatherless + motherless + sisterless + brotherless + orphan + you can't catch this ratio + catch some bitches + I don't care about your opinion + genshin player + you dress like garbage + 日本語がお上手ですね + get fucked + you cant understand what the word intelligence means with your dumb ass + you have hair + queued + put some thought into what you're going to do with that + stfu + go to bed + yes, i'm taller than you + i think your joke is funny + i rejected your mother's advances + marooned + you cant read + I win + final ratio
state = &_states[history];
}
if (state->sentReadTill == tillId) {
state->sentReadDone = true;

View file

@ -982,7 +982,7 @@ void MainMenu::setupMenu() {
{&st::ayuSReadMenuIcon}
)->setClickedCallback([=]
{
auto box = Box<AyuUi::ConfirmationBox>(controller);
auto box = Box<AyuUi::ServerReadConfirmationBox>(controller);
Ui::show(std::move(box));
});
}