mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +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);
|
||||
}
|
||||
|
||||
void SetChatLinkDraft(
|
||||
not_null<PeerData*> peer,
|
||||
const TextWithEntities &draft) {
|
||||
void SetChatLinkDraft(not_null<PeerData*> peer, TextWithEntities draft) {
|
||||
static const auto kInlineStart = QRegularExpression("^@[a-zA-Z0-9_]");
|
||||
if (kInlineStart.match(draft.text).hasMatch()) {
|
||||
draft = TextWithEntities().append(' ').append(std::move(draft));
|
||||
}
|
||||
|
||||
const auto textWithTags = TextWithTags{
|
||||
draft.text,
|
||||
TextUtilities::ConvertEntitiesToTextTags(draft.entities)
|
||||
|
|
|
@ -205,8 +205,6 @@ using HistoryDrafts = base::flat_map<DraftKey, std::unique_ptr<Draft>>;
|
|||
&& (a->webpage == b->webpage);
|
||||
}
|
||||
|
||||
void SetChatLinkDraft(
|
||||
not_null<PeerData*> peer,
|
||||
const TextWithEntities &draft);
|
||||
void SetChatLinkDraft(not_null<PeerData*> peer, TextWithEntities draft);
|
||||
|
||||
} // namespace Data
|
||||
|
|
Loading…
Add table
Reference in a new issue