Open alphapapa opened 3 years ago
Any clues on how one might implement this in the current codebase as ement-notify-functions no longer exists since commit 70da19e4c921?
Here is how I ended up doing this on version 0.5.2:
(cl-defun viiru/ement-notify-track-if-buffer (event room session &key (buffer-name "*Ement Notifications*"))
(with-demoted-errors "viiru/ement-notify-track-if-buffer: %S"
(when (ement-notify--room-buffer-live-p event room session)
(tracking-add-buffer (map-elt (ement-room-local room) 'buffer)))))
(advice-add 'ement-notify--log-to-buffer :after #'viiru/ement-notify-track-if-buffer)
Where do I get the "tracking-add-buffer" function from? Circe?
Ok, I didn't get it running. I also think, if you should use some foreign tracking library, perhaps use one that is included in vanilla emacs? the one from ERC?
No, this is based on tracking.el from circe. The current version of my setup is here: https://gist.github.com/viiru-/685134a1781816e83df68520a4862599
I also do a bunch of other stuff to adjust how the room names are shortened and so on (to get closer to what I had under ERC), but those are easy enough to adjust to taste.
Wibjarm posted this in #ement.el:matrix.org:
I'm not sure what the best thing to do now is: add this to the readme as a simple example of code users can copy into their config, put it in an
ement-tracking.el
file that users can load, or put it intoement-notify.el
in a way that avoids compile-time, load-time, and run-time warnings.