Skip to content

Commit

Permalink
Merge pull request 'Enable carbons by default.' (legoscia#31) from hd…
Browse files Browse the repository at this point in the history
…asch/emacs-jabber:enable-carbons into production

No negative feedback from xmpp:[email protected]?join
  • Loading branch information
Hugh Daschbach committed Jul 2, 2023
2 parents e41ae55 + bdbd0cf commit 41feea9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [[https://keepachangelog.com/en/1.0.0/][Keep a Changelog]
:PROPERTIES:
:CUSTOM_ID: new-features-jabberel-latest-git
:END:
** Enable carbons by default
:PROPERTIES:
:CUSTOM_ID: enable-carbons-by-default
:END:
Enable support for XEP-0280 (message carbons) by default.
** Support for reading passwords from netrc/authinfo files
:PROPERTIES:
:CUSTOM_ID: support-reading-passwords-from-netrc-authinfo-files
Expand Down
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ To install the Info documentation, copy =jabber.info= to =/usr/local/info= and r
- [[https://codeberg.org/emacs-jabber/emacs-jabber/pulls/2][PR #2]]
+ Hugh Daschbach (hdasch)
- MUC presence announcements
- Enable XEP-0280 (message carbons) by default

** Maintainers
:PROPERTIES:
Expand Down
7 changes: 6 additions & 1 deletion lisp/jabber-carbons.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

(defun jabber-carbon-success (jc xml-data context)
(when (equal "result" (jabber-xml-get-attribute xml-data 'type))
(message "Carbons feature successfully enabled")))
(message "Carbons feature successfully enabled for %s"
(jabber-connection-jid jc))))

(defun jabber-carbon-failure (jc xml-data context)
(message "Carbons feature could not be enabled: %S" xml-data))

(add-to-list 'jabber-jid-service-menu
(cons "Enable Carbons" 'jabber-enable-carbons))

;;;###autoload
(defun jabber-enable-carbons (jc)
"Send request to enable XEP-0280 Message Carbons.
Expand All @@ -26,6 +29,8 @@ JC is the Jabber connection."
#'jabber-carbon-success "Carbons feature enablement"
#'jabber-carbon-failure "Carbons feature enablement"))

(jabber-disco-advertise-feature "urn:xmpp:carbons:2")

(provide 'jabber-carbons)

;;; jabber-carbons.el ends here
3 changes: 2 additions & 1 deletion lisp/jabber-core.el
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
(defcustom jabber-post-connect-hooks '(jabber-send-current-presence
jabber-muc-autojoin
jabber-whitespace-ping-start
jabber-vcard-avatars-find-current)
jabber-vcard-avatars-find-current
jabber-enable-carbons)
"*Hooks run after successful connection and authentication.
The functions should accept one argument, the connection object."
:type 'hook
Expand Down

0 comments on commit 41feea9

Please sign in to comment.