mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Fix fast reply from message corner in Replies section.
This commit is contained in:
parent
e8a58c4c8d
commit
745bbfe268
4 changed files with 16 additions and 2 deletions
|
@ -1427,6 +1427,14 @@ bool RepliesWidget::showMessage(
|
||||||
return true;
|
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) {
|
void RepliesWidget::saveState(not_null<RepliesMemento*> memento) {
|
||||||
memento->setReplies(_replies);
|
memento->setReplies(_replies);
|
||||||
memento->setReplyReturns(_replyReturns);
|
memento->setReplyReturns(_replyReturns);
|
||||||
|
|
|
@ -88,6 +88,7 @@ public:
|
||||||
PeerId peerId,
|
PeerId peerId,
|
||||||
const Window::SectionShow ¶ms,
|
const Window::SectionShow ¶ms,
|
||||||
MsgId messageId) override;
|
MsgId messageId) override;
|
||||||
|
bool replyToMessage(not_null<HistoryItem*> item) override;
|
||||||
|
|
||||||
void setInternalState(
|
void setInternalState(
|
||||||
const QRect &geometry,
|
const QRect &geometry,
|
||||||
|
|
|
@ -534,8 +534,9 @@ bool MainWidget::shareUrl(
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWidget::replyToItem(not_null<HistoryItem*> item) {
|
void MainWidget::replyToItem(not_null<HistoryItem*> item) {
|
||||||
if (_history->peer() == item->history()->peer
|
if ((!_mainSection || !_mainSection->replyToMessage(item))
|
||||||
|| _history->peer() == item->history()->peer->migrateTo()) {
|
&& (_history->peer() == item->history()->peer
|
||||||
|
|| _history->peer() == item->history()->peer->migrateTo())) {
|
||||||
_history->replyToMessage(item);
|
_history->replyToMessage(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,10 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool replyToMessage(not_null<HistoryItem*> item) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a memento of that section to store it in the history stack.
|
// Create a memento of that section to store it in the history stack.
|
||||||
// This method may modify the section ("take" heavy items).
|
// This method may modify the section ("take" heavy items).
|
||||||
virtual std::unique_ptr<SectionMemento> createMemento();
|
virtual std::unique_ptr<SectionMemento> createMemento();
|
||||||
|
|
Loading…
Add table
Reference in a new issue