about summary refs log tree commit diff stats
path: root/lisp/+jabber.el
blob: a0fdea7af5f5114c34489bb97ed165bc3707ba1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; +jabber.el --- Customizations for jabber.el -*- lexical-binding: t; -*-

;;; Commentary:

;; Most changes I want to PR and contribute, but a few don't make sense to
;; contribute upstream, at least not now.

;;; Code:

(require 'jabber)
(require 'tracking)

(defvar +jabber-tracking-show-p #'jabber-activity-show-p-default
  "Function that checks if the given JID should be shown in the mode line.
This does the same as `jabber-activity-show-p', but for the
`tracking-mode' mode-line.")

(defun +jabber-tracking-add (from buffer text proposed-alert)
  "ADVICE to add jabber buffers to `tracking-buffers'."
  (when (funcall +jabber-tracking-show-p from)
    (tracking-add-buffer buffer 'jabber-activity-face)))

(defun +jabber-tracking-add-muc (nick group buffer text proposed-alert)
  "ADVICE to add jabber MUC buffers to `tracking-buffers'."
  (when (funcall +jabber-tracking-show-p group)
    (tracking-add-buffer buffer 'jabber-activity-face)))

;;; TODO: Hiding presence messages:
;; https://paste.sr.ht/~hdasch/f0ad09fbcd08e940a4fda71c2f40abc1c4efd45f

(provide '+jabber)
;;; +jabber.el ends here