Skip to content

Commit

Permalink
Merge pull request #21 from sarg/feature/revoke-message
Browse files Browse the repository at this point in the history
Support deleting message without revoking for other party.
  • Loading branch information
zevlg authored Jun 26, 2018
2 parents d914931 + bd36e8a commit 868abe7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions telega-chat.el
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ Keymap:
"Show info about chat."
(interactive)
(telega-chat-show-info telega-chatbuf--chat))

(defun telega-chat-buffer--killed ()
"Called when chat buffer is killed."
(ignore-errors
Expand Down Expand Up @@ -1013,13 +1013,14 @@ With prefix arg, apply markdown formatter to message."
telega-chatbuf--send-args (list (plist-get msg :id)))
))

(defun telega-msg-delete (msg)
"Delete message MSG."
(interactive (list (button-get (button-at (point)) :value)))
(defun telega-msg-delete (msg &optional revoke)
"Delete message MSG.
With prefix arg delete only for yourself."
(interactive (list (button-get (button-at (point)) :value) (not current-prefix-arg)))

(when (y-or-n-p "Kill the message? ")
(when (y-or-n-p (concat (if revoke "Revoke" "Kill") " the message? "))
(telega-msg--deleteMessages
(plist-get msg :chat_id) (list (plist-get msg :id)) t)))
(plist-get msg :chat_id) (list (plist-get msg :id)) revoke)))

(defun telega-chat-complete-username ()
"Complete username at point."
Expand Down

0 comments on commit 868abe7

Please sign in to comment.