branch: elpa/jabber
commit ab62fb15c89da4e17398f6bd3403208571a545f1
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>
chat: Add MUC actions to operations menu
---
lisp/jabber-chatbuffer.el | 10 ++++++++++
lisp/jabber-muc.el | 6 ++++++
2 files changed, 16 insertions(+)
diff --git a/lisp/jabber-chatbuffer.el b/lisp/jabber-chatbuffer.el
index 71c8077d00..e49323ec65 100644
--- a/lisp/jabber-chatbuffer.el
+++ b/lisp/jabber-chatbuffer.el
@@ -59,6 +59,8 @@ previous sequence detect the mismatch and stop.")
;; Global reference declarations
+(defvar jabber-muc-menu-map)
+
(declare-function jabber-muc-nick-completion-at-point
"jabber-muc-nick-completion.el" ())
(declare-function jabber-httpupload--upload "jabber-httpupload"
(jc filepath callback))
@@ -331,6 +333,12 @@ MAM sync in this buffer. Set via the operations menu.")
(when (yes-or-no-p (format "Remove %s from roster? " jid))
(jabber-roster-delete jabber-buffer-connection jid))))
+(defun jabber-chat-muc-actions-menu ()
+ "Show MUC actions for the current chat buffer."
+ (interactive)
+ (require 'jabber-muc)
+ (keymap-popup jabber-muc-menu-map))
+
(keymap-popup-define jabber-chat-operations-menu-map
:description (lambda ()
(let ((peer (or (bound-and-true-p jabber-group)
@@ -358,6 +366,8 @@ MAM sync in this buffer. Set via the operations menu.")
"E" ("Edit last message" jabber-correct-last-message)
"r" ("Reply to message" jabber-chat-reply)
:group "MUC"
+ "m" ("MUC Actions" jabber-chat-muc-actions-menu
+ :if (lambda () (bound-and-true-p jabber-group)))
"M" ("Retract message at point" jabber-moderation-retract
:if (lambda () (bound-and-true-p jabber-group)))
"X" ("Retract all by occupant" jabber-moderation-retract-by-occupant
diff --git a/lisp/jabber-muc.el b/lisp/jabber-muc.el
index afc89f72cf..915b6821d0 100644
--- a/lisp/jabber-muc.el
+++ b/lisp/jabber-muc.el
@@ -2015,6 +2015,12 @@ Accesses `jabber-pending-groupchats' to determine our
nickname."
(keymap-popup-define jabber-muc-menu-map
"Jabber MUC commands."
+ :description (lambda ()
+ (if (bound-and-true-p jabber-group)
+ (format "MUC actions for %s"
+ (propertize jabber-group 'face
+ 'font-lock-constant-face))
+ "MUC actions"))
:group "Room"
"j" ("Join" jabber-muc-join)
"J" ("Create room" jabber-muc-create)