summaryrefslogtreecommitdiff
path: root/jabber-chat.el
diff options
context:
space:
mode:
authorMagnus Henoch <mange@freemail.hu>2007-09-14 23:14:03 +0000
committerKirill A. Korinskiy <catap@catap.ru>2007-09-14 23:14:03 +0000
commit7ff1356826371f1acf114817c171cddaec38b5b5 (patch)
tree3e7f058dc7c3504bf8eef509f178f9764751ced5 /jabber-chat.el
parent3f177f70ed067b02850ddcbb9a96dc9b362f5a57 (diff)
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-410
Creator: Magnus Henoch <mange@freemail.hu> Subscription requests are sent to chat buffers
Diffstat (limited to 'jabber-chat.el')
-rw-r--r--jabber-chat.el21
1 files changed, 19 insertions, 2 deletions
diff --git a/jabber-chat.el b/jabber-chat.el
index 07f917c..fc6c0db 100644
--- a/jabber-chat.el
+++ b/jabber-chat.el
@@ -349,7 +349,7 @@ This function is used as an ewoc prettyprinter."
(jabber-chat-self-prompt (or (jabber-x-delay original-timestamp)
internal-time)
delayed))
- (:foreign
+ ((:foreign :subscription-request)
;; For :error and :notice, this might be a string... beware
(jabber-chat-print-prompt (when (listp (cadr data)) (cadr data))
(or (jabber-x-delay original-timestamp)
@@ -380,7 +380,24 @@ This function is used as an ewoc prettyprinter."
(insert (cadr data)))
(:rare-time
(insert (jabber-propertize (format-time-string jabber-rare-time-format (cadr data))
- 'face 'jabber-rare-time-face))))
+ 'face 'jabber-rare-time-face)))
+ (:subscription-request
+ (insert "This user requests subscription to your presence.\n")
+ (when (and (stringp (cadr data)) (not (zerop (length (cadr data)))))
+ (insert "Message: " (cadr data) "\n"))
+ (insert "Accept?\n\n")
+ (flet ((button
+ (text action)
+ (if (fboundp 'insert-button)
+ (insert-button text 'action action)
+ ;; simple button replacement
+ (let ((keymap (make-keymap)))
+ (define-key keymap "\r" action)
+ (insert (jabber-propertize text 'keymap keymap 'face 'highlight))))
+ (insert "\t")))
+ (button "Mutual" 'jabber-subscription-accept-mutual)
+ (button "One-way" 'jabber-subscription-accept-one-way)
+ (button "Decline" 'jabber-subscription-decline))))
(when jabber-chat-fill-long-lines
(save-restriction