diff --git a/telega-chat.el b/telega-chat.el index 2c24cd7..94ee723 100644 --- a/telega-chat.el +++ b/telega-chat.el @@ -5667,7 +5667,16 @@ Return non-nil on success." (cl-assert (eq (button-type msg-button) 'telega-msg)) (with-no-warnings (pulse-momentary-highlight-region - (button-start msg-button) (button-end msg-button)))) + (button-start msg-button) (button-end msg-button)) + (when (stringp highlight) + (save-excursion + (goto-char (button-start msg-button)) + (if (search-forward highlight (button-end msg-button) t) + (let ((start-point (match-beginning 0)) + (end-point (match-end 0))) + (sit-for 0.5) + (pulse-momentary-highlight-region start-point end-point)) + (message "The exact quote is not found")))))) (when callback (funcall callback msg-button))) diff --git a/telega-msg.el b/telega-msg.el index ae9f7ff..a96f6d1 100644 --- a/telega-msg.el +++ b/telega-msg.el @@ -354,9 +354,11 @@ Return nil for deleted messages." "Goto message denoted by `:reply_to' field of the message MSG." (let* ((reply-to (plist-get msg :reply_to)) (chat-id (plist-get reply-to :chat_id)) - (msg-id (plist-get reply-to :message_id))) + (msg-id (plist-get reply-to :message_id)) + (quote (plist-get reply-to :quote)) + (quote-text (plist-get quote :text))) (unless (or (telega-zerop chat-id) (telega-zerop msg-id)) - (telega-chat--goto-msg (telega-chat-get chat-id) msg-id 'highlight)))) + (telega-chat--goto-msg (telega-chat-get chat-id) msg-id quote-text)))) (defun telega-msg-open-sticker (msg &optional sticker) "Open content for sticker message MSG."