mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Provide a draft from notification to correct thread.
This commit is contained in:
parent
06d1644baa
commit
76330eaaa6
1 changed files with 6 additions and 3 deletions
|
@ -985,15 +985,18 @@ void Manager::notificationActivated(
|
||||||
id.msgId);
|
id.msgId);
|
||||||
const auto topic = item ? item->topic() : nullptr;
|
const auto topic = item ? item->topic() : nullptr;
|
||||||
if (!reply.text.isEmpty()) {
|
if (!reply.text.isEmpty()) {
|
||||||
// #TODO forum notifications
|
const auto topicRootId = topic
|
||||||
|
? topic->rootId()
|
||||||
|
: id.contextId.topicRootId;
|
||||||
const auto replyToId = (id.msgId > 0
|
const auto replyToId = (id.msgId > 0
|
||||||
&& !history->peer->isUser())
|
&& !history->peer->isUser()
|
||||||
|
&& id.msgId != topicRootId)
|
||||||
? id.msgId
|
? id.msgId
|
||||||
: 0;
|
: 0;
|
||||||
auto draft = std::make_unique<Data::Draft>(
|
auto draft = std::make_unique<Data::Draft>(
|
||||||
reply,
|
reply,
|
||||||
replyToId,
|
replyToId,
|
||||||
(topic ? topic->rootId() : 0),
|
topicRootId,
|
||||||
MessageCursor{
|
MessageCursor{
|
||||||
int(reply.text.size()),
|
int(reply.text.size()),
|
||||||
int(reply.text.size()),
|
int(reply.text.size()),
|
||||||
|
|
Loading…
Add table
Reference in a new issue