I wrote this in 2006, and both Gaim and Citadel have moved on since then. It's bit-rotted to uselessness, most likely; it's only here because some people asked to see the code. It probably wouldn't be hard to update to work with libpurple and the new Citadel protocol, but I don't intend to do so. Feel free! Meanwhile, I don't even know if it builds any more.
Its main point of interest is that the Citadel protocol is actually handled by code in Lua, using Lua coroutines to invert the normal Gaim state machine architecture. This is much easier than building a traditional huge state machine, especially since the Citadel protocol is very stateful. The Lua bindings to Gaim are done using tolua. Read the README for more information.
The program is GPLv2 licensed.