as my train got stuck in the first real winter night here, I thought it
was the right time to make my mind about what could be improved in
Gajim's handling of accounts and contacts.

You can see this as a first outbreak that I would like to share with you
as soon as possible. Comments and ideas are welcome.  :-)

See "1. accounts.png"

I'd like to centralize information in account classes instead of
spreading it over several dictionaries (most of them in

Furthermore I'd really like to pull out functionality from
roster_window. At the moment new roster_data (on connect, received by
xmpp) will be directed to roster_window that is responsible for
creating contact instances and placing those in common/contacts.py.

Last but not least XMPPEntity is meant to simplify a lot of coding. We
don't need to pass plain jids around any longer. We will always know the
account of a jid and what type it is (e.g "groupchat contact" or "a
normal jid with resource")

To understand more about XMPPEntity, just read on.

See "2. contacts.py"

The class diagram is looking more complicated than it really is. You can
understand ContactRosterInterface and ContactChatInterface as everything
that is required to add a "Contact" (as currently defined in
common/Contacts.py) to roster_window or to start a chat with a contact.

The rest was designed to simplify coding that has to run on several
"Contacts" (e.g assigning a nick to a contact that is online with 5
resources or to move a metacontact to a new group).

I see working on this as a good starting point for several reasons.
On the one hand we can keep 95% of our code in place as it will be just
backward compatible. The rest can be easily ported to the new API. One
by one we can migrate and simplify components by letting them use the
newly defined interfaces.
On the other hand I see this as a good basis for writing regression
tests. That way, contacts and accounts should be much easier to test and
even to mock.

What do you think?

Best Regards,

<<inline: 1. accounts.png>>

<<inline: 2. contacts.png>>

Gajim-devel mailing list

Reply via email to