[Sugar-devel] Overlay chat architecture

Andrés Ambrois andresambrois at gmail.com
Sat Aug 15 21:49:56 EDT 2009


On Saturday 15 August 2009 06:50:06 pm Benjamin M. Schwartz wrote:
> I've been thinking about overlay chat, and I wonder
>
> 1.  Has there been any code written to that end?

http://git.sugarlabs.org/projects/sugar-toolkit/repos/sugar-toolkit-chat

This was done a while ago, but I was slowed down when trying to make palettes 
pop-up from the buddy icons in the friends tray (right frame). In any case it 
may need a rebase, but the bureaucratic code for mapping the different types of 
channel handles (our addresses in the telepathy channels) with buddy keys 
(what sugar can easily get from buddy_ps.props.key) worked fine. 

It also keeps references to all the text channels as a class attribute to 
avoid looking for them on every activity switch. 

> 2.  Has anyone thought about the necessary architecture?
>
> Overlay chat requires a number of things working together: per-activity
> daemons, spawned when sharing starts, with references to the telepathy
> channels for each activity, as well as bidirectional access to the Friends
> tray for GUI.  It's not clear to me, for example, what code in Sugar could
> launch such a daemon.

See sugar/src/jarabe/frame/friendstray.py. My idea was to keep it simple and 
consistent by making the BuddyModel (jarabe/model/buddy.py) hold one of these 
objects (the owner would hold a ChatPitcher, the rest a ChatCatcher*) and 
expose a signal/method for events.

This would mean both the icons used in the friendstray and in the neighborhood 
view have access to this service through the BuddyModel.

Also, I don't think we need a process for each activity. Since we can only 
show chats from one activity at a time, and telepathy holds unacknowledged 
messages. We can just subscribe a class method to 'chat-received' in all 
channels for notifications.

*: These are awful names, someone please come up with something more clever.

> --Ben

-- 
  -Andrés


More information about the Sugar-devel mailing list