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);
|
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
|
||||||
|
Reference in New Issue
Block a user