From: Magnus H. <leg...@us...> - 2014-08-29 09:57:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "emacs-jabber". The branch, master has been updated via 7df437d1d8beeca967d0372f36862a27f507ffbc (commit) via 662442143dca54393c66ac710fc5aedd78c8b850 (commit) from e1c008cfb95202720613bcdb361dec86aa855285 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7df437d1d8beeca967d0372f36862a27f507ffbc Author: Magnus Henoch <mag...@gm...> Date: Fri Aug 29 10:40:30 2014 +0100 Support "instant configuration" of MUC rooms diff --git a/jabber-muc.el b/jabber-muc.el index a525c8a..95066e3 100644 --- a/jabber-muc.el +++ b/jabber-muc.el @@ -405,6 +405,20 @@ JID; only provide completion as a guide." (let ((muc-name (format "%s/%s" group nickname))) (jabber-vcard-get jc muc-name))) +(defun jabber-muc-instant-config (jc group) + "Accept default configuration for GROUP. +This can be used for a newly created room, as an alternative to +filling out the configuration form with `jabber-muc-get-config'. +Both of these methods unlock the room, so that other users can +enter it." + (interactive (jabber-muc-argument-list)) + (jabber-send-iq jc group + "set" + '(query ((xmlns . "http://jabber.org/protocol/muc#owner")) + (x ((xmlns . "jabber:x:data") (type . "submit")))) + #'jabber-report-success "MUC instant configuration" + #'jabber-report-success "MUC instant configuration")) + (add-to-list 'jabber-jid-muc-menu (cons "Configure groupchat" 'jabber-muc-get-config)) @@ -1135,7 +1149,6 @@ Return nil if X-MUC is nil." ;; Was this room just created? If so, it's a locked ;; room. Notify the user. (when (member "201" status-codes) - ;; TODO: suggest instant configuration (ewoc-enter-last jabber-chat-ewoc (list :muc-notice @@ -1145,6 +1158,10 @@ Return nil if X-MUC is nil." (insert-text-button "configure the room" 'action (apply-partially 'call-interactively 'jabber-muc-get-config)) + (insert " or ") + (insert-text-button + "accept the default configuration" + 'action (apply-partially 'call-interactively 'jabber-muc-instant-config)) (insert ".") (buffer-string)) :time (current-time)))))))))))) commit 662442143dca54393c66ac710fc5aedd78c8b850 Author: Magnus Henoch <mag...@gm...> Date: Fri Aug 29 10:33:02 2014 +0100 Add link to room configuration if room is locked diff --git a/jabber-muc.el b/jabber-muc.el index 19b912d..a525c8a 100644 --- a/jabber-muc.el +++ b/jabber-muc.el @@ -1135,13 +1135,18 @@ Return nil if X-MUC is nil." ;; Was this room just created? If so, it's a locked ;; room. Notify the user. (when (member "201" status-codes) - ;; TODO: suggest instant configuration, and add - ;; clickable buttons. + ;; TODO: suggest instant configuration (ewoc-enter-last jabber-chat-ewoc (list :muc-notice - (concat "This room was just created, and is locked to other participants.\n" - "To unlock it, configure the room.") + (with-temp-buffer + (insert "This room was just created, and is locked to other participants.\n" + "To unlock it, ") + (insert-text-button + "configure the room" + 'action (apply-partially 'call-interactively 'jabber-muc-get-config)) + (insert ".") + (buffer-string)) :time (current-time)))))))))))) (provide 'jabber-muc) ----------------------------------------------------------------------- Summary of changes: jabber-muc.el | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) hooks/post-receive -- emacs-jabber |