Less Work is More Work

I began a rewrite of the Galago framework a few days ago. The original design was good for my initial testing, but I didn’t plan to stick with it. One of the neat things in this rewrite is that unless a feed wants to, it doesn’t have to manually push any presence info. Instead, the code (either via a plugin or the main code of the program) just keeps a couple structs (GalagoAccount, GalagoPerson, GalagoPresence, etc) updated as it does things, and the events automatically propagate.

This has required a number of new considerations when developing this, but I’ve worked out most of them. From an API standpoint, developing an application to work with Galago is really easy now, even easier than before.

The new framework allows for basic identity information, so you can say, “Give me all presence information for Christian Hammond.” Each feed will have a GalagoPerson per each user, which may or may not have a name or other info associated with it. When the daemon receives the presence info, it will get the person info along with that. The people and accounts are stored in a graph in order to determine if accounts are shared anywhere. If so, it can merge the person daemon-side and feed it to any watches or queries.

So, if Gaim sends presence for MyUsername, and Evolution sends a GalagoPerson with some GalagoAccounts for Christian Hammond, and one of the accounts is MyUsername, the daemon will associate them and pass it along. It should work well, barring any unforseen problems.

On a side note, Movable Type is being very strange and only listing one blog entry on the index page. I’m hoping this post bumps it and makes it work again, as it was working just a few days ago. Oh well.

Gaim Goodies

I’ve finally been getting back into Gaim development a bit lately, outside of the status rewrite. The multi-field request API, which is used for abstracting request dialogs with various forms of input for a Gaim UI to generate dialogs from, got several improvements.

Some fields are marked now as required fields. If set, the UI can grey out the OK button when those fields aren’t filled out. This only applies to text entry fields at the moment, but support can easily be added for other types (if it makes sense for them).

An account field type was also added, which was the final piece allowing us to replace the New Instant Message and Get User Info dialogs with the request API. A lot of GTK+ code was removed from this change, and it improved consistency and HIG compliance.

And last but not least in this department, type hints have been added to fields, which the UI can use for additional functionality. The first use in Gaim is that if a text field has a type hint of “screenname,” the text field will get support for auto-completion of screen names.

And with that fun out of the way, work continues on the status rewrite. Oh so fun…

Emotional Presence

I’ve been toying around with an idea for some time now for a form of emotional presence. The idea being that not only can you tell somebody’s active state, but how they’re feeling. This would conceptually be integrated into instant messengers (although no protocol that I know of supports such a thing currently), and of course Galago would supply the info as well.

So say you decide you want to talk to somebody on your buddy list. Before sending him/her a message, you can check on the buddy’s emotional presence. Then you can make an estimate as to whether or not the person is in a good mood, bad mood, ready to kill someone, contemplating, horny, etc.

The best way to convey such information is by using an eye. The eye is our best way of judging a person’s response, so why not? Smilies could work, but that’s just not good enough. Now, there are a couple of ways to do this. The easiest way is to let the user just set his/her emotional state in the instant messenger like they would an away message. This, like away messages, would just come naturally to some people over time, but others wouldn’t think about it.

Another way of doing it is to have a camera and some face recognition software going that can scan the guy, take a little snapshot, and display it. This is obviously not going to work for everybody, and is a bit more work. This is all just concept stuff right now, though, so implementation is something we can put off just a bit.

I’m sure many of us know people who never use any form of smiley/emoticon during a conversation. They often seem almost machine-like, or perhaps not in a good mood, even if they’re feeling on top of the world. Emotional presence during a conversation could help to fix this. Even if the person showed no emotion in his/her text, the eyes would paint a different picture.

Of course, as someone said, not everyone would want to see a big eyeball on their desktop. Depending on the implementation, this could be changed to text, or a smiley, or hidden altogether.

Oh yeah, and DanielS just put the new Planet Freedesktop.org site up with my new layout. Woo!

Moving On

Life took a bit of a turn for the worse recently, relationship-wise. My now ex-girlfriend, whom I cared deeply for, and I broke up, and it ended pretty badly. So, it’s time to move on, find someone who perhaps is more compatible, and get some code written again.

Gaim’s status rewrite is now moving along well, aside from the past few days, when I’ve just been dealing with the aforementioned issues. I still don’t have a definite ETA for completion, but the core code is now mostly there. It likely won’t be able to do some of the really complex status combinations people wanted, but that can be done through a second layer (as it should). Anything more complex than what it currently is would require a really complex API, and none of us wants that.

Galago has been moved to SVN over on freedesktop.org, and I’ll likely get a page up soonish, after tests and other responsibilities. After I figure out a couple of design issues, support for presence feed capabilities will go in, and the work on Evolution’s Galago support will be nearly finished.

Sometime this week, I plan on finishing up a bug fix for Gaim for Qtopia and releasing 0.5. It’s long overdue, and people are waiting for some of the fixes to go in.

Just got to get my motivation back after the break-up. Metroid Prime is also sucking up my time, but that’s probably not a bad thing right now.

Sleepless

It’s really hard when you can no longer be with someone you love, but it doesn’t make it any easier when you have to spend over an hour each night just trying to sleep, and when you finally do, you’re consumed by bad dreams. I wish sleep was purely optional. I feel like I haven’t really slept in weeks.

Oh, and I didn’t forget it or anything, but yesterday marked one year that my Grandma has been dead. Rest in peace, Grandma.

Productivity Shattered!

I was given an invite to Orkut yesterday. For those of you who don’t know what Orkut is, get out from under your rock 🙂 It’s a rather interesting waste of time, and it’s delayed a lot of my development. I think I’ll be getting back to that in a few minutes though. Just.. just five more minutes.. then I’ll code.. Promise.

My copy of Dream Theater – Change of Seasons and Metropolis 2000: Scenes From New York came yesterday, and I spent the better part of today watching/listening to them. Excellent stuff.

While on the topic of that, it’d be nice to see some kind of CD ripper integration in Nautilus. Right-click an audio CD and get a Rip To Music entry or something, which brings up a dialog allowing ripping to wav, mp3, ogg, flac, etc. Maybe multiple ones at once? I wouldn’t mind flac and ogg copies. For now though, Grip is my friend.

Reasons for Galago’s Design

I have received several criticisms regarding my design for Galago, most of which I believe to be misunderstandings as to what the eventual goals are. Unfortunately, such misunderstandings and criticisms are now leading to duplicated effort, something which really is not needed.

First off, Galago does require a daemon running in the background, though it’s not something that users are going to have to deal with, so that shouldn’t be a major problem. The main question I have received is, why use a daemon? Why not just have everything listen on the interfaces in D-BUS?

A couple of people have suggested that a daemon is pointless and serves no value. Originally, my design for Galago did not include a daemon. Everything would simply listen on the interfaces and report back. This design proved to be flawed, however. Let me start off with an example.

Say you’re using Gaim to provide feed information, and then you start up a program that uses Galago to receive presence information. Every time you open up a window on this program (let’s pretend it’s something with an address book), the Galago-Gtk widgets are given information on what user’s presence should be monitored. Of course, since it’s just monitoring for new presence updates, it doesn’t have anything currently set. So, each widget makes a query to receive the current presence information.

Now, Gaim had already pushed presence for these users before. As a Galago feed, Gaim is able to push presence when a user’s presence changes, which is quite quick, or it search through the buddy list and build a presence list when specifically polled. The polling is what these widgets have to do to receive initial status. You wouldn’t want to just have them wait with no active presence information until someone signs on/off or sets away.

So, back to our address book. Each widget queries for presence. In a design with no daemon, each feed would receive the poll and send back a response. This could be a lengthy operation, depending on the program feeding presence, or it could be quick. Either way, each feed is going to have to send the presence again.

With a design requiring a daemon, that information has already been pushed and cached. When the widgets in the address book poll for the current presence for a user, the daemon will simply return what it has stored. This is much faster and doesn’t require re-polling every program. It’s also smarter, as it can determine which to poll based on the registration time of a feed (more on that in a second), instead of polling every single program every time.

One person pointed out that you wouldn’t be running Gaim and Kopete at the same time. This, however, is not always true. I know of people who run Gaim and AMSN at the same time, and those who run Kopete and AMSN. Regardless, this particular point wasn’t well thought-out. Not only instant messaging programs provide presence. IRC programs, Gnomemeeting, and other collaboration software.. heck, even a program feeding presence for users logged in to the computer can all provide presence at once. I try not to limit my designs to “what do I need right now, I can always expand it later!” That’s a bad design method, imho.

There are more reasons for the daemon requirements. Feeds will soon be registering themselves when created. It’s something that the developers using the API won’t have to really see or touch. The libraries handle it. Registration simply registers the feed with an ID, descriptive name, and a couple other small pieces of information. This allows the daemon to keep a list of what feeds are available, which can be polled, which can push, their sign-on times and last active times, and actions (sending a message, for instance). Any program can query for a list of applications providing presence, and display them in something like a drop-down protocol box.

Avatars will soon be able to be sent along with presence. This is something else that the daemon can cache, though that may be an option in a preferences file, not that many people would need to modify it. The idea is to have such items expire so that memory is not taken up by unnecessary items. This does require a re-poll from time to time, but it’s considerably less work than polling every feed every time we want to display something.

Finally, Galago is not an instant messaging platform. It is for presence, which instant messaging programs can use or provide if they choose. It is not limited to instant messaging programs either, as I mentioned above. I find it unfortunate that a duplicated effort is going on when the two really should work with each other, but that’s the beauty of open source.

Galago-Gtk#, Freedesktop.org

I spent part of the day working on Mono bindings for Galago-Gtk. I now have running a C# version of the Icon Entry test that was in the previous entry. Later, I’ll write bindings for libgalago itself. What’s nice is that this will allow me to prototype much faster. I’m hoping to get someone to do Python bindings. I may handle Ruby myself. Of course, there’s no rush, as the whole system needs to be developed further.

Just a short while ago, Daniel Stone was nice enough to setup a CVS account on freedesktop.org for Galago. It no longer has to run off my slow little CVS server here. I’ll soon get a page up and people can start playing with it.

I’m playing around with the idea of creating a little applet that displays presence info for selected user(s). I don’t know if there would be an icon per person, or one icon with a drop-down. If the later, whichever person is selected on the drop-down will be the new entry on the applet. I’d personally find it useful, and it would be a good little real-world test of Galago.

Galago Status – Widgets and Avatars

The past two days, I have been hacking on a new Gtk widget that will be included in libgalago-gtk. It’s a nice little subclass of a GtkEntry that includes an embedded icon, as shown below:

GalagoGtkEntry screenshot

It has a lot of work to go, but so far it’s rather nice.

Avatar development has just begun in libgalago. Avatars, aka Buddy Icons or That Little Picture of Me will be able to be pushed and received just like presence information. This is untested, but should be working by tomorrow, along with a little Gtk widget for easily displaying them.

I think the next trick is to write a general GalagoConnection API that wraps DBusConnection and allows feeds and watches to be registered to it, so that we can eliminate this one connection per feed/watch requirement Galago currently has.

Gaim Status Rewrite

I’ve been going through several drafts of the status rewrite for Gaim, to make it less AIM-centric as well as core/UI split, and more advanced. The trick is doing this in a way that doesn’t suck. By doesn’t suck, I mean that it’s a clean API that is expandable without being confusing.

Currently, the idea is to have a few main structs:

GaimStatusType – A type of status, containing the account it’s associated with (or probably just the protocol ID), the status type ID, name, parent slot (see GaimStatusSlot below), list of attributes (see GaimStatusAttr below), the primary attribute ID, whether it’s saveable, and whether it’s settable by the user in some fashion.

GaimStatusAttr – An attribute in a status type. It has an ID and a name, and the type of value it has.

GaimStatus – A specific created status, containing the type of status, the associated buddy or account, whether or not it’s active, and a hashtable of filled in values for the attributes in the status type.

GaimStatusSlot – A way of grouping statuses internally. It contains a list of status types, and a flag indicating whether or not the status types inside are all exclusive.

GaimStatusBundle – This is what is created and stored when a user defines their status (which may be an advanced mode in the UI). The status bundle has a name and a list of status IDs that map to it. This is used to, say, set an Away status, but to have it activate “Be Right Back” on MSN and Jabber, a certain away message on AIM. This is of course not something the user is going to have to do. They should be able to set away just like how they currently do.

The trick with GaimStatusBundle is to do things in a way where it supports global status types and protocol-specific ones. Although there really isn’t a distinction… It references by ID. I guess we’d just have to standardize some. I need to think about that more.

It all sounds a bit complex, but it’s pretty easy really. Each protocol plugin registers one or more slots, each with a status type. Each status type can have an attribute. When a user makes a new user-settable status, like an away message, they can build it individually for a specific account or protocol, or globally. It can be as simple as an Away type with an away message (using a standard “away” status type ID and making it global), or they can get complex and set up a scenario like one depicted above.

Status types will be able to go a bit further. Since not all status types are even settable by the user, there can be status types indicating that a user is on a mobile device, that they’re an op in a channel, or whatever. The API for those parts need to be drafted, but once in the base is in place, that shouldn’t be a big deal.

I still have a lot to fledge out. It needs to be slightly complex to be useful, but I think it’ll be manageable.

Scroll to Top