This post originated from an RSS feed registered with Python Buzz
by Phillip Pearson.
Original Post: Hacking Pidgin to only flash the tray icon when your nick is mentioned in a chat
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Pidgin is awesome - it's a cross-platform IM client (I'm running it on Windows) for pretty much every IM network except Skype. One thing I've wanted to change for a while is the 'blink window on received message' function; many of my coworkers are using Adium or iChat or some other OS X app that only tries to grab your attention if (a) you receive a personal IM, or (b) your username is mentioned in a chat.
Here are some notes about the process, to refresh my memory if I come back to this in a few months' time, or maybe to help others get into the Pidgin code, if anyone is working in a similar area...
It's surprisingly easy (for a project with so many dependencies) to get up and running with a build environment on Windows. Once you've got Cygwin installed, there's a script that will fetch all the build deps and the latest source for you, then you're ready to go with make -f Makefile.mingw install.
There are two hooks that result in the window being flashed; the prefs (see prefs.xml in your .purple directory) are called /pidgin/win32/blink_im (which, if set, blinks the window when you get a private message) and /plugins/gtk/purplerc/win32/winprefs/chat_blink (which, if set, blinks the window when you get a message in a chat). Not sure why one is a main Pidgin setting and one is inside the gtk plugin, but there you go.
The Tools | Preferences | Conversations | Flash window when IMs are received option is set in pidgin/gtkprefs.c.
The Tools | Plugins | Windows Pidgin Options | Flash window when chat messages are received option is set in pidgin/plugins/win32/winprefs/winprefs.c. I wonder if this could be moved into the Conversations config pane?
Another interesting option is Tools | Preferences | Sounds | Someone says your username in chat (set in finch/gntsound.c and pidgin/gtksound.c), which plays a sound when someone says your name. I normally work with sounds turned off, though.
Here's my patch to add an option to the Windows plugin to flash the window when your username is mentioned. I also get it to flash the window if someone says phil, myelin or pearsonp; you'll probably want to remove that bit from the patch.