mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fix crash in restrict-from-recent-actions.
This commit is contained in:
@@ -942,20 +942,27 @@ void EditRestrictedBox::prepare() {
|
|||||||
if (!_saveCallback) {
|
if (!_saveCallback) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const auto show = uiShow();
|
||||||
|
const auto rankPeer = peer();
|
||||||
|
const auto rankUser = user();
|
||||||
|
const auto rank = _tagControl
|
||||||
|
? _tagControl->currentRank()
|
||||||
|
: _oldRank;
|
||||||
|
const auto saveRank = (rank != _oldRank);
|
||||||
|
|
||||||
|
// May destroy the box.
|
||||||
_saveCallback(
|
_saveCallback(
|
||||||
_oldRights,
|
_oldRights,
|
||||||
ChatRestrictionsInfo{ value(), getRealUntilValue() });
|
ChatRestrictionsInfo{ value(), getRealUntilValue() });
|
||||||
if (_tagControl) {
|
|
||||||
const auto rank = _tagControl->currentRank();
|
if (saveRank) {
|
||||||
if (rank != _oldRank) {
|
SaveMemberRank(
|
||||||
SaveMemberRank(
|
show,
|
||||||
uiShow(),
|
rankPeer,
|
||||||
peer(),
|
rankUser,
|
||||||
user(),
|
rank,
|
||||||
rank,
|
nullptr,
|
||||||
nullptr,
|
nullptr);
|
||||||
nullptr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
addButton(tr::lng_settings_save(), save);
|
addButton(tr::lng_settings_save(), save);
|
||||||
|
|||||||
Reference in New Issue
Block a user