mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +00:00
Fix crash in channel setup box.
This commit is contained in:
@@ -773,26 +773,25 @@ void SetupChannelBox::updateSelected(const QPoint &cursorGlobalPosition) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetupChannelBox::save() {
|
void SetupChannelBox::save() {
|
||||||
if (_privacyGroup->value() == Privacy::Private) {
|
if (_saveRequestId) {
|
||||||
|
return;
|
||||||
|
} else if (_privacyGroup->value() == Privacy::Private) {
|
||||||
if (_existing) {
|
if (_existing) {
|
||||||
_sentUsername = QString();
|
_sentUsername = QString();
|
||||||
_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
|
_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
|
||||||
} else {
|
} else {
|
||||||
closeBox();
|
closeBox();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
const auto link = _link->text().trimmed();
|
||||||
if (_saveRequestId) return;
|
|
||||||
|
|
||||||
QString link = _link->text().trimmed();
|
|
||||||
if (link.isEmpty()) {
|
if (link.isEmpty()) {
|
||||||
_link->setFocus();
|
_link->setFocus();
|
||||||
_link->showError();
|
_link->showError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sentUsername = link;
|
_sentUsername = link;
|
||||||
_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
|
_saveRequestId = MTP::send(MTPchannels_UpdateUsername(_channel->inputChannel, MTP_string(_sentUsername)), rpcDone(&SetupChannelBox::onUpdateDone), rpcFail(&SetupChannelBox::onUpdateFail));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupChannelBox::handleChange() {
|
void SetupChannelBox::handleChange() {
|
||||||
|
Reference in New Issue
Block a user