[sugar] [PATCH] 1-1 Chat (non-Sugar Jabber clients #6298)

Guillaume Desmottes guillaume.desmottes
Wed May 7 04:51:53 EDT 2008


Le mercredi 07 mai 2008 ? 10:03 +0200, Morgan Collett a ?crit :
> I've attached patches for Sugar and Chat that handle incoming XMPP 1-1
> connections, from a non-Sugar Jabber client.
> 
> It's a bit of a proof of concept, because although it works there are
> some issues that need improving - so please review and comment... I'm
> looking for input from Marco/Tomeu, Eben, Daf/Guillaume...
> 
> * From a Jabber client registered on the Jabber server I initiate a
> chat with the Buddy.
> * Presence Service sends private-invitation to sugar.presence and then
> to the shell.
> * The signal has the Telepathy channel for this 1-1 connection which
> needs to get to Chat.
> * I'm (ab)using activityfactory.create_with_uri to launch Chat with
> the Telepathy channel in the metadata.
> * That makes Chat launch magically. That violates the requirement that
> the user initiate the activity.
> * I'm using json (probably badly?) to pass the two strings identifying
> the Telepathy channel.
> * The first message from the non-Sugar client (which initiates the
> connection) gets dropped somewhere, and only subsequent messages get
> through to Chat.


I guess you should be able to got this message using
channel[CHANNEL_TYPE_TEXT].ListPendingMessages()
See
http://telepathy.freedesktop.org/spec.html#org.freedesktop.Telepathy.Channel.Type.Text
We should probably call it in set_received_callback()

Btw, it seems we never acked received messages. Is that intentional?
According the spec each message should be acked when they are displayed.


> * Presence Service sends private-invitation on both CHANNEL_TYPE_TEXT
> and CHANNEL_TYPE_STREAMED_MEDIA (which should go to video chat
> eventually). When we have agreed on how to handle Chat I'll figure out
> how to differentiate them and send the media one to video chat.

You can find the type of the channel by calling 
GetChannelType() on the channel object.

Or maybe we could just add the channel type in the signal.

> It has also been suggested that the incoming chat appear as an
> invitation. I had a look but couldn't yet figure out how best to
> represent something that is not an activity, does not have colors, and
> is not a room on the server. Input appreciated.
> 

I agree, displaying an incoming chat as an invitation is much more saner
than automatically launch Chat.


	G.




More information about the Sugar-devel mailing list