mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Removed sending of typing action when sticker is chose in autocomplete.
This commit is contained in:
parent
de3b1ff9ae
commit
c1d3e5f0c5
4 changed files with 22 additions and 19 deletions
Telegram/SourceFiles/history
|
@ -1359,9 +1359,9 @@ void HistoryWidget::orderWidgets() {
|
|||
_attachDragAreas.photo->raise();
|
||||
}
|
||||
|
||||
void HistoryWidget::updateStickersByEmoji() {
|
||||
bool HistoryWidget::updateStickersByEmoji() {
|
||||
if (!_peer) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
const auto emoji = [&] {
|
||||
const auto errorForStickers = Data::RestrictionError(
|
||||
|
@ -1379,23 +1379,24 @@ void HistoryWidget::updateStickersByEmoji() {
|
|||
return EmojiPtr(nullptr);
|
||||
}();
|
||||
_fieldAutocomplete->showStickers(emoji);
|
||||
return (emoji != nullptr);
|
||||
}
|
||||
|
||||
void HistoryWidget::fieldChanged() {
|
||||
const auto typing = (_history
|
||||
&& !_inlineBot
|
||||
&& !_editMsgId
|
||||
&& (_textUpdateEvents & TextUpdateEvent::SendTyping));
|
||||
|
||||
InvokeQueued(this, [=] {
|
||||
updateInlineBotQuery();
|
||||
updateStickersByEmoji();
|
||||
});
|
||||
|
||||
if (_history) {
|
||||
if (!_inlineBot
|
||||
&& !_editMsgId
|
||||
&& (_textUpdateEvents & TextUpdateEvent::SendTyping)) {
|
||||
const auto choosingSticker = updateStickersByEmoji();
|
||||
if (!choosingSticker && typing) {
|
||||
session().sendProgressManager().update(
|
||||
_history,
|
||||
Api::SendProgressType::Typing);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
updateSendButtonType();
|
||||
if (!HasSendText(_field)) {
|
||||
|
|
|
@ -154,7 +154,7 @@ public:
|
|||
QRect historyRect() const;
|
||||
|
||||
void updateFieldPlaceholder();
|
||||
void updateStickersByEmoji();
|
||||
bool updateStickersByEmoji();
|
||||
|
||||
bool confirmSendingFiles(const QStringList &files);
|
||||
bool confirmSendingFiles(not_null<const QMimeData*> data);
|
||||
|
|
|
@ -1279,9 +1279,9 @@ void ComposeControls::initAutocomplete() {
|
|||
_autocomplete->hideFast();
|
||||
}
|
||||
|
||||
void ComposeControls::updateStickersByEmoji() {
|
||||
bool ComposeControls::updateStickersByEmoji() {
|
||||
if (!_history) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
const auto emoji = [&] {
|
||||
const auto errorForStickers = Data::RestrictionError(
|
||||
|
@ -1299,6 +1299,7 @@ void ComposeControls::updateStickersByEmoji() {
|
|||
return EmojiPtr(nullptr);
|
||||
}();
|
||||
_autocomplete->showStickers(emoji);
|
||||
return (emoji != nullptr);
|
||||
}
|
||||
|
||||
void ComposeControls::updateFieldPlaceholder() {
|
||||
|
@ -1343,11 +1344,9 @@ void ComposeControls::updateSilentBroadcast() {
|
|||
}
|
||||
|
||||
void ComposeControls::fieldChanged() {
|
||||
if (!_inlineBot
|
||||
const auto typing = (!_inlineBot
|
||||
&& !_header->isEditingMessage()
|
||||
&& (_textUpdateEvents & TextUpdateEvent::SendTyping)) {
|
||||
_sendActionUpdates.fire({ Api::SendProgressType::Typing });
|
||||
}
|
||||
&& (_textUpdateEvents & TextUpdateEvent::SendTyping));
|
||||
updateSendButtonType();
|
||||
if (!HasSendText(_field)) {
|
||||
_previewState = Data::PreviewState::Allowed;
|
||||
|
@ -1358,7 +1357,10 @@ void ComposeControls::fieldChanged() {
|
|||
}
|
||||
InvokeQueued(_autocomplete.get(), [=] {
|
||||
updateInlineBotQuery();
|
||||
updateStickersByEmoji();
|
||||
const auto choosingSticker = updateStickersByEmoji();
|
||||
if (!choosingSticker && typing) {
|
||||
_sendActionUpdates.fire({ Api::SendProgressType::Typing });
|
||||
}
|
||||
});
|
||||
|
||||
if (!(_textUpdateEvents & TextUpdateEvent::SaveDraft)) {
|
||||
|
|
|
@ -221,7 +221,7 @@ private:
|
|||
|
||||
void orderControls();
|
||||
void checkAutocomplete();
|
||||
void updateStickersByEmoji();
|
||||
bool updateStickersByEmoji();
|
||||
void updateFieldPlaceholder();
|
||||
void updateSilentBroadcast();
|
||||
void editMessage(not_null<HistoryItem*> item);
|
||||
|
|
Loading…
Add table
Reference in a new issue