[Telepathy] tp_cli_connection_manager_run_request_connection(): What parameter types.

Murray Cumming murrayc at murrayc.com
Wed Oct 29 03:07:18 PDT 2008


On Tue, 2008-10-28 at 18:38 +0000, Will Thompson wrote:
> On 28/10/08 17:17, Murray Cumming wrote:
> > I now have a connection and tried to connect the connection. I am
> > surprised that I didn't get a GError in this test code:
> > http://git.collabora.co.uk/?p=telepathy-doc.git;a=blob;f=docs/examples/list_contacts/main.c
> >
> > I am quite sure that my jabber password is not "passwordTODO". Am I
> > missing something?
> >   
> 
> :-) Yes. From the specification (and indeed the documentation of
> tp_cli_connection_run_connect):
> 
> > Request that the connection be established. This will be done
> > asynchronously and errors will be returned by emitting StatusChanged
> > signals.
[snip]

Sorry.

By the way, I think that documentation should explicitly mention 
so people don't think that it's talking about a GObject signal.

However, I tried this, and I just get 

StatusChanged(Connecting, Requested),
StatusChanged(Disconnecting, Requested)

If this isn't getting too dull for you, I'd really appreciate it if you
looked at my code. It's probably a simple mistake:
http://git.collabora.co.uk/?p=telepathy-doc.git;a=blob;f=docs/examples/list_contacts/main.c

> So, Connect returning successfully just means that the connection
> manager will start trying to connect.
> 
> Having created the Connection, you should connect to the StatusChanged
> signal, then call Connect. The connection will emit
> StatusChanged(Connecting, Requested), and subsequently either emit
> StatusChanged(Connected, None_Specified) if the connection succeeds, or
> StatusChanged(Disconnected, Authentication).
> 
> For the sake of your example, the StatusChanged handler probably just
> wants to log a message when the new state is Connecting. If it gets
> Connected, it can start kicking off the relevant method calls to list
> contacts, and subsequently call Disconnect() which will cause
> StatusChanged(Disconnected, Requested) (at which point you probably want
> to g_main_loop_quit () so the example exits). If it gets Disconnected
> for any reason other than requested, it should log the reason (which in
> the passwordTODO case will be Authentication_Failed) and
> g_main_loop_quit ().

-- 
murrayc at murrayc.com
www.murrayc.com
www.openismus.com



More information about the Telepathy mailing list