]> crepu.dev Git - config.git/blob - djavu-asus/emacs/elpa/jabber-20230715.456/jabber-carbons.el
d4258c10e88a1e14720dbae01b6360512e327c1c
[config.git] / djavu-asus / emacs / elpa / jabber-20230715.456 / jabber-carbons.el
1 ;;; jabber-carbons.el --- Support for XEP-0280: Message Carbons -*- lexical-binding: t; -*-
2
3 ;;; Commentary:
4 ;;
5
6 ;;; Code:
7
8 (defun jabber-carbon-success (jc xml-data context)
9 (when (equal "result" (jabber-xml-get-attribute xml-data 'type))
10 (message "Carbons feature successfully enabled for %s"
11 (jabber-connection-jid jc))))
12
13 (defun jabber-carbon-failure (jc xml-data context)
14 (message "Carbons feature could not be enabled: %S" xml-data))
15
16 (add-to-list 'jabber-jid-service-menu
17 (cons "Enable Carbons" 'jabber-enable-carbons))
18
19 ;;;###autoload
20 (defun jabber-enable-carbons (jc)
21 "Send request to enable XEP-0280 Message Carbons.
22
23 JC is the Jabber connection."
24 (interactive (list (jabber-read-account)))
25 (jabber-send-iq jc
26 nil
27 "set"
28 `(enable ((xmlns . "urn:xmpp:carbons:2")))
29 #'jabber-carbon-success "Carbons feature enablement"
30 #'jabber-carbon-failure "Carbons feature enablement"))
31
32 (jabber-disco-advertise-feature "urn:xmpp:carbons:2")
33
34 (provide 'jabber-carbons)
35
36 ;;; jabber-carbons.el ends here