Today I had an itch, and scratched it. But I scratched
it in a very ugly way...
What I wanted to do was to get some sort of
notification that I did not miss when a certain friend
of mine came online. If he had used Jabber or ICQ I
could have sent him an off-line message but that is not
possible with MSN.
So, I dived into the code and added some hard-coded test in
jabber-presence-echo, like this:
(defun jabber-presence-echo (who oldstatus newstatus
"Show a message in the echo area"
(if (string-match "johan" proposed-alert)
(w32-net-send-send "mdahse" proposed-alert))
(message "%s" proposed-alert)))
Now, this is extremely hard coded of course:
- mdahse is my user name at work
- w32-net-send-send is part of my package w32-net-send
- "johan" is hard coded
- it does not matter if Johan comes online or goes offline
- etc ad finitum...
It would be cool if there was a very general way of
executing action X when Y changes status to Z or, for
that matter, doing X when something Y happens. Hmm,
maybe this is too wierd...
The specific problem I had could of course also be
solved by some kind of message queue stored in Emacs
(in memory to start with), for IM systems that does not
Anyway, I solved my problem for now, but maybe this
will give you hackers some idea of something cool to
add to the next release.
Log in to post a comment.