mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix inline query draft applying.
This commit is contained in:
parent
7a6c55bd8a
commit
6f328b2ef8
2 changed files with 7 additions and 6 deletions
|
@ -129,9 +129,12 @@ void ClearPeerCloudDraft(
|
||||||
history->applyCloudDraft(topicRootId);
|
history->applyCloudDraft(topicRootId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChatLinkDraft(
|
void SetChatLinkDraft(not_null<PeerData*> peer, TextWithEntities draft) {
|
||||||
not_null<PeerData*> peer,
|
static const auto kInlineStart = QRegularExpression("^@[a-zA-Z0-9_]");
|
||||||
const TextWithEntities &draft) {
|
if (kInlineStart.match(draft.text).hasMatch()) {
|
||||||
|
draft = TextWithEntities().append(' ').append(std::move(draft));
|
||||||
|
}
|
||||||
|
|
||||||
const auto textWithTags = TextWithTags{
|
const auto textWithTags = TextWithTags{
|
||||||
draft.text,
|
draft.text,
|
||||||
TextUtilities::ConvertEntitiesToTextTags(draft.entities)
|
TextUtilities::ConvertEntitiesToTextTags(draft.entities)
|
||||||
|
|
|
@ -205,8 +205,6 @@ using HistoryDrafts = base::flat_map<DraftKey, std::unique_ptr<Draft>>;
|
||||||
&& (a->webpage == b->webpage);
|
&& (a->webpage == b->webpage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetChatLinkDraft(
|
void SetChatLinkDraft(not_null<PeerData*> peer, TextWithEntities draft);
|
||||||
not_null<PeerData*> peer,
|
|
||||||
const TextWithEntities &draft);
|
|
||||||
|
|
||||||
} // namespace Data
|
} // namespace Data
|
||||||
|
|
Loading…
Add table
Reference in a new issue