From 85eb0551a90cc75427221a4671f7f86724c7a6bc Mon Sep 17 00:00:00 2001 From: noa@gaiwan.org Date: Sat, 29 Jun 2024 09:32:05 +0000 Subject: Use a user-defined function for filtering xmpp chats in header line --- config.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'config.org') diff --git a/config.org b/config.org index 112a5d0..3edae50 100644 --- a/config.org +++ b/config.org @@ -459,6 +459,26 @@ So now what we're going to do is get it to stop showing a bunch of channels in t (cl-return t)))))))(setopt jabber-activity-show-p #'noa/jabber-activity-show-p) #+end_src +Because i have a lot of irc channels shown, a lot of the jids are quite long and ugly. Mostly i know what irc server a channel belongs to, so i want to cut off the parts after the percentage symbol. + +I might want to look at the jabber-jid-username function which seems to do this. + +#+begin_src elisp + (defun noa/jabber-activity-make-string (jid) + "Return the nick of the JID. + If no nick is available, return the user name part of the JID. In + private MUC conversations, return the user's nickname." + (if (jabber-muc-sender-p jid) + (jabber-jid-resource jid) + (let ((nick (jabber-jid-displayname jid)) + (user (jabber-jid-user jid)) + (username (jabber-jid-username jid))) + (if (and username (string= nick user)) + username + nick)))) + (setopt jabber-activity-make-string #'noa/jabber-activity-make-string) +#+end_src + I'm on a laptop, so whenever i shut it i get disconnected. Jabber can query auth-source for my password, so automatically reconnecting is useful and doesn't need me to do anything. #+begin_src elisp -- cgit 1.4.1-2-gfad0