[Telepathy] obtaining handles to contacts to establish a text channel

harini satyanarayanan hpundis1 at binghamton.edu
Tue Feb 19 12:20:26 PST 2008


It worked finally, i guess it was probably a badly organized code or
data structure, i modified it and it worked. this is the working
snippet of the code.



    const gchar  *id = "contact at gmail.com";


    const gchar *contact_ids[] = {id, NULL};


    success = tp_conn_request_handles (DBUS_G_PROXY
(tp_connection),TP_CONN_HANDLE_TYPE_CONTACT,contact_ids, &handles1,
&error1);
    handle1 = g_array_index(handles1, guint, 0);
    g_array_free (handles1, TRUE);

Thanks for all the help!!!! :)

thanks,
harini


On Feb 19, 2008 11:31 AM, harini satyanarayanan <hpundis1 at binghamton.edu> wrote:
> It does not throw any error while creating the handle, it creates a
> handle but later when it comes to creating the interface and the text
> channel it throws an error that the handle is not valid.
>
> when i print the handle it always prints the same number 152352 for
> any contact i mention. here is the output of the code
>
>  handle for text channel = 152352
>  Attempting to create a text channel object.
> mission-control-test[1310]: GLIB WARNING ** default - RequestChannel()
> failed: handle 152352 is not currently a valid contact handle (type 1)
> (org.freedesktop.Telepathy.Error.InvalidArgument)
> mission-control-test[1310]: GLIB WARNING ** default - Failed to create
> a channel (tp_chan) object.
> mission-control-test[1310]: GLIB CRITICAL ** default -
> tp_chan_get_interface: assertion `self != NULL' failed
> Could not acquire text interface proxy for channel for pending messages
> mission-control-test[1310]: GLIB CRITICAL ** default -
> tp_chan_get_interface: assertion `self != NULL' failed
> Could not acquire text interface proxy for channel for sending messages
>
> this is the handle i get for any contact i mention. I just randomly
> changed the handle numbers and i figured out that it accepts any
> number from  2 to 62 since i have 62 contacts also when handle is 1 it
> is self messaging.
>
> I tried only giving the contact name still no change. any help or
> pointers is greatly appreciated
>
> thanks
> harini
>
>
> On Feb 19, 2008 4:16 AM, Sjoerd Simons <sjoerd at luon.net> wrote:
> > On Mon, Feb 18, 2008 at 08:16:13PM -0500, harini satyanarayanan wrote:
> > > It throws an error that didnt get handle for contact. If this is wrong
> > > then how do i mention the contact to which i have to send the message.
> > >
> > > const gchar* lists1[] = { "contact at gmail.com", NULL };
> > >          GArray *handles1 = NULL;
> > >
> > >     if (!tp_conn_request_handles (DBUS_G_PROXY(tp_connection),
> > > TP_HANDLE_TYPE_CONTACT, lists,  &handles1, &error))  {
> > >
> > >       g_warning("Didn't get a handle for the '%s' list\n", lists1[0]);
> >
> > I don't see any obvious mistakes here. But you might want to print
> > error->message, to see what causes RequestHandles to fail.
> >
> >   Sjoerd
> > --
> > It is now quite lawful for a Catholic woman to avoid pregnancy by a resort to
> > mathematics, though she is still forbidden to resort to physics and chemistry.
> >                 -- H. L. Mencken
> >
>


More information about the Telepathy mailing list