mirror of https://github.com/procxx/kepka.git
Fix reply-returns in just sent messages.
This commit is contained in:
parent
a42fb1f7b7
commit
1d1bd5e1e7
|
@ -473,7 +473,7 @@ Data::MessagePosition HistoryItem::position() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgId HistoryItem::replyToId() const {
|
MsgId HistoryItem::replyToId() const {
|
||||||
if (auto reply = Get<HistoryMessageReply>()) {
|
if (const auto reply = Get<HistoryMessageReply>()) {
|
||||||
return reply->replyToId();
|
return reply->replyToId();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -154,7 +154,7 @@ bool HistoryMessageReply::updateData(
|
||||||
|
|
||||||
updateName();
|
updateName();
|
||||||
|
|
||||||
replyToLnk = goToMessageClickHandler(replyToMsg, holder->fullId());
|
setReplyToLinkFrom(holder);
|
||||||
if (!replyToMsg->Has<HistoryMessageForwarded>()) {
|
if (!replyToMsg->Has<HistoryMessageForwarded>()) {
|
||||||
if (auto bot = replyToMsg->viaBot()) {
|
if (auto bot = replyToMsg->viaBot()) {
|
||||||
replyToVia = std::make_unique<HistoryMessageVia>();
|
replyToVia = std::make_unique<HistoryMessageVia>();
|
||||||
|
@ -170,6 +170,13 @@ bool HistoryMessageReply::updateData(
|
||||||
return (replyToMsg || !replyToMsgId);
|
return (replyToMsg || !replyToMsgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HistoryMessageReply::setReplyToLinkFrom(
|
||||||
|
not_null<HistoryMessage*> holder) {
|
||||||
|
replyToLnk = replyToMsg
|
||||||
|
? goToMessageClickHandler(replyToMsg, holder->fullId())
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void HistoryMessageReply::clearData(not_null<HistoryMessage*> holder) {
|
void HistoryMessageReply::clearData(not_null<HistoryMessage*> holder) {
|
||||||
replyToVia = nullptr;
|
replyToVia = nullptr;
|
||||||
if (replyToMsg) {
|
if (replyToMsg) {
|
||||||
|
|
|
@ -117,6 +117,8 @@ struct HistoryMessageReply : public RuntimeComponent<HistoryMessageReply, Histor
|
||||||
ClickHandlerPtr replyToLink() const {
|
ClickHandlerPtr replyToLink() const {
|
||||||
return replyToLnk;
|
return replyToLnk;
|
||||||
}
|
}
|
||||||
|
void setReplyToLinkFrom(
|
||||||
|
not_null<HistoryMessage*> holder);
|
||||||
|
|
||||||
MsgId replyToMsgId = 0;
|
MsgId replyToMsgId = 0;
|
||||||
HistoryItem *replyToMsg = nullptr;
|
HistoryItem *replyToMsg = nullptr;
|
||||||
|
|
|
@ -1082,6 +1082,11 @@ void HistoryMessage::setRealId(MsgId newId) {
|
||||||
HistoryItem::setRealId(newId);
|
HistoryItem::setRealId(newId);
|
||||||
Auth().data().groups().refreshMessage(this);
|
Auth().data().groups().refreshMessage(this);
|
||||||
Auth().data().requestItemResize(this);
|
Auth().data().requestItemResize(this);
|
||||||
|
if (const auto reply = Get<HistoryMessageReply>()) {
|
||||||
|
if (reply->replyToLink()) {
|
||||||
|
reply->setReplyToLinkFrom(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryMessage::dependencyItemRemoved(HistoryItem *dependency) {
|
void HistoryMessage::dependencyItemRemoved(HistoryItem *dependency) {
|
||||||
|
|
Loading…
Reference in New Issue