branch: elpa/jabber
commit f5c6d3258af5854827d96defab0c9dfd4d9a17c3
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    muc: Separate command menu
---
 lisp/jabber-chat-commands.el |  1 +
 lisp/jabber-muc-menu.el      | 58 ++++++++++++++++++++++++++++++++++++++++++++
 lisp/jabber-muc.el           | 38 +----------------------------
 lisp/jabber.el               |  1 +
 4 files changed, 61 insertions(+), 37 deletions(-)

diff --git a/lisp/jabber-chat-commands.el b/lisp/jabber-chat-commands.el
index 8185e0bec5..eb69e9d246 100644
--- a/lisp/jabber-chat-commands.el
+++ b/lisp/jabber-chat-commands.el
@@ -28,6 +28,7 @@
 (require 'jabber-message-reply)
 (require 'jabber-moderation)
 (require 'jabber-muc)
+(require 'jabber-muc-menu)
 (require 'jabber-presence)
 (require 'jabber-reactions)
 
diff --git a/lisp/jabber-muc-menu.el b/lisp/jabber-muc-menu.el
new file mode 100644
index 0000000000..206fed0d95
--- /dev/null
+++ b/lisp/jabber-muc-menu.el
@@ -0,0 +1,58 @@
+;;; jabber-muc-menu.el --- Multi-user chat command menu  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2026  Thanos Apollo
+
+;; Maintainer: Thanos Apollo <[email protected]>
+
+;; This file is a part of jabber.el.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;;; Commentary:
+
+;; Assemble the MUC popup after its protocol and information providers load.
+
+;;; Code:
+
+(require 'keymap-popup)
+(require 'jabber-info)
+(require 'jabber-muc)
+
+(defvar jabber-muc-menu-map)
+
+(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)
+  "l" ("Leave" jabber-muc-leave)
+  "t" ("Set topic" jabber-muc-set-topic)
+  "c" ("Configure" jabber-muc-get-config)
+  :group "Participants"
+  "n" ("Change nick" jabber-muc-nick)
+  "I" ("Get info" jabber-muc-get-info)
+  "i" ("Invite" jabber-muc-invite)
+  "w" ("List participants" jabber-muc-names)
+  "p" ("Private chat" jabber-muc-private)
+  "v" ("Request vcard" jabber-muc-vcard-get)
+  :group "Admin"
+  "r" ("Set role" jabber-muc-set-role)
+  "a" ("Set affiliation" jabber-muc-set-affiliation))
+
+(defun jabber-muc-menu ()
+  "Show the Jabber MUC command menu."
+  (interactive)
+  (keymap-popup jabber-muc-menu-map))
+
+(provide 'jabber-muc-menu)
+
+;;; jabber-muc-menu.el ends here
diff --git a/lisp/jabber-muc.el b/lisp/jabber-muc.el
index 56d4077c19..b032a58df2 100644
--- a/lisp/jabber-muc.el
+++ b/lisp/jabber-muc.el
@@ -29,7 +29,6 @@
 ;;; Code:
 
 (require 'cl-lib)
-(require 'keymap-popup)
 (require 'ewoc)
 (require 'jabber-widget)
 (require 'jabber-disco)
@@ -39,6 +38,7 @@
 (require 'jabber-chat)
 (require 'jabber-db)
 (require 'jabber-presence)
+(require 'jabber-version)
 
 (defvar jabber-muc-participants nil
   "Alist of groupchats and participants.
@@ -231,7 +231,6 @@ The format is that of `mode-line-format' and 
`header-line-format'."
 (declare-function jabber-message-correct--apply "jabber-message-correct"
                   (replace-id new-body new-from muc-p buffer
                               &optional new-occupant-id))
-(declare-function jabber-get-version "jabber-version.el" (jc to))
 (declare-function jabber-reactions--reaction-only-p "jabber-reactions"
                   (xml-data))
 (declare-function jabber-vcard-get "jabber-vcard.el" (jc jid))
@@ -1906,40 +1905,5 @@ Accesses `jabber-pending-groupchats' to determine our 
nickname."
                                  x-muc actor reason our-nickname)))))
 (jabber-disco-advertise-feature jabber-muc-xmlns-direct-invite)
 
-;;; MUC menu
-
-(declare-function jabber-muc-get-info "jabber-info.el" (jc group nickname))
-(declare-function jabber-muc-vcard-get "jabber-muc.el" (jc group 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)
-  "l" ("Leave" jabber-muc-leave)
-  "t" ("Set topic" jabber-muc-set-topic)
-  "c" ("Configure" jabber-muc-get-config)
-  :group "Participants"
-  "n" ("Change nick" jabber-muc-nick)
-  "I" ("Get info" jabber-muc-get-info)
-  "i" ("Invite" jabber-muc-invite)
-  "w" ("List participants" jabber-muc-names)
-  "p" ("Private chat" jabber-muc-private)
-  "v" ("Request vcard" jabber-muc-vcard-get)
-  :group "Admin"
-  "r" ("Set role" jabber-muc-set-role)
-  "a" ("Set affiliation" jabber-muc-set-affiliation))
-
-(defun jabber-muc-menu ()
-  "Jabber MUC commands."
-  (interactive)
-  (keymap-popup jabber-muc-menu-map))
-
 (provide 'jabber-muc)
 ;;; jabber-muc.el ends here.
diff --git a/lisp/jabber.el b/lisp/jabber.el
index 31b6a940eb..1d3bd05d64 100644
--- a/lisp/jabber.el
+++ b/lisp/jabber.el
@@ -194,6 +194,7 @@ One disabled account with a non-standard port:
 (require 'jabber-autoaway)
 (require 'jabber-time)
 (require 'jabber-disco-menu)
+(require 'jabber-muc-menu)
 (require 'jabber-roster-menu)
 (require 'jabber-chat-commands)
 (require 'jabber-uri)

Reply via email to