mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Fix inline query draft applying.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user