mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
_inPinnedMsg flag now always is set to false when destroying _pinnedBar
This commit is contained in:
@@ -3606,9 +3606,7 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
||||
_migrated->unreadBar->destroy();
|
||||
}
|
||||
if (_pinnedBar) {
|
||||
delete _pinnedBar;
|
||||
_pinnedBar = nullptr;
|
||||
_inPinnedMsg = false;
|
||||
destroyPinnedBar();
|
||||
}
|
||||
_history = _migrated = 0;
|
||||
updateBotKeyboard();
|
||||
@@ -6844,9 +6842,7 @@ void HistoryWidget::updatePinnedBar(bool force) {
|
||||
if (_peer && _peer->isMegagroup()) {
|
||||
_peer->asChannel()->mgInfo->pinnedMsgId = 0;
|
||||
}
|
||||
delete _pinnedBar;
|
||||
_pinnedBar = nullptr;
|
||||
_inPinnedMsg = false;
|
||||
destroyPinnedBar();
|
||||
resizeEvent(0);
|
||||
update();
|
||||
}
|
||||
@@ -6894,8 +6890,7 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||
App::api()->requestMessageData(_peer->asChannel(), _pinnedBar->msgId, new ReplyEditMessageDataCallback());
|
||||
}
|
||||
} else if (_pinnedBar) {
|
||||
delete _pinnedBar;
|
||||
_pinnedBar = nullptr;
|
||||
destroyPinnedBar();
|
||||
result = true;
|
||||
_scroll.scrollToY(_scroll.scrollTop() - st::replyHeight);
|
||||
resizeEvent(0);
|
||||
@@ -6903,6 +6898,12 @@ bool HistoryWidget::pinnedMsgVisibilityUpdated() {
|
||||
return result;
|
||||
}
|
||||
|
||||
void HistoryWidget::destroyPinnedBar() {
|
||||
delete _pinnedBar;
|
||||
_pinnedBar = nullptr;
|
||||
_inPinnedMsg = false;
|
||||
}
|
||||
|
||||
void HistoryWidget::ReplyEditMessageDataCallback::call(ChannelData *channel, MsgId msgId) const {
|
||||
if (App::main()) {
|
||||
App::main()->messageDataReceived(channel, msgId);
|
||||
|
Reference in New Issue
Block a user