Fix fast reply from message corner in Replies section.
This commit is contained in:
parent
e8a58c4c8d
commit
745bbfe268
|
@ -1427,6 +1427,14 @@ bool RepliesWidget::showMessage(
|
|||
return true;
|
||||
}
|
||||
|
||||
bool RepliesWidget::replyToMessage(not_null<HistoryItem*> item) {
|
||||
if (item->history() != _history || item->replyToTop() != _rootId) {
|
||||
return false;
|
||||
}
|
||||
_composeControls->replyToMessage(item->fullId());
|
||||
return true;
|
||||
}
|
||||
|
||||
void RepliesWidget::saveState(not_null<RepliesMemento*> memento) {
|
||||
memento->setReplies(_replies);
|
||||
memento->setReplyReturns(_replyReturns);
|
||||
|
|
|
@ -88,6 +88,7 @@ public:
|
|||
PeerId peerId,
|
||||
const Window::SectionShow ¶ms,
|
||||
MsgId messageId) override;
|
||||
bool replyToMessage(not_null<HistoryItem*> item) override;
|
||||
|
||||
void setInternalState(
|
||||
const QRect &geometry,
|
||||
|
|
|
@ -534,8 +534,9 @@ bool MainWidget::shareUrl(
|
|||
}
|
||||
|
||||
void MainWidget::replyToItem(not_null<HistoryItem*> item) {
|
||||
if (_history->peer() == item->history()->peer
|
||||
|| _history->peer() == item->history()->peer->migrateTo()) {
|
||||
if ((!_mainSection || !_mainSection->replyToMessage(item))
|
||||
&& (_history->peer() == item->history()->peer
|
||||
|| _history->peer() == item->history()->peer->migrateTo())) {
|
||||
_history->replyToMessage(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,6 +125,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool replyToMessage(not_null<HistoryItem*> item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a memento of that section to store it in the history stack.
|
||||
// This method may modify the section ("take" heavy items).
|
||||
virtual std::unique_ptr<SectionMemento> createMemento();
|
||||
|
|
Loading…
Reference in New Issue