Buddy Status

Giuseppe Santoro giuseppesantoro87 at gmail.com
Mon Mar 15 10:08:20 EDT 2010


Hi,

yes, I'm sure the buddy is online. I tried this code:

for(buddies = purple_blist_get_buddies(); buddies; buddies = buddies->next)
{
        buddy = buddies->data;
        PurplePresence *presence = purple_buddy_get_presence(buddy);
        PurpleStatus *status = purple_presence_get_active_status(presence);

        printf("%s - ", purple_status_get_name(status));
        *printf("%s - ",
purple_primitive_get_id_from_type(purple_status_type_get_primitive(purple_status_get_type(status))));
*        printf("%s (%s)\n", purple_buddy_get_name(buddy),
purple_buddy_get_alias(buddy));
}

OUTPUT is:

Offline - offline - xxxxxx at xxxx.com (xxxxxx at xxxx.com)
Offline - offline - xxxxxx at xxxx.com (xxxxxx at xxxx.com)
......
Offline - offline - xxxxxx at xxxx.com (xxxxxx at xxxx.com)

I can see who are online by the name.
I use MSN protocol.

Other suggestions?

Thanks,
Giuseppe Santoro


2010/3/15 Mark Doliner <mark at kingant.net>

> On Sun, Mar 14, 2010 at 11:43 AM, Giuseppe Santoro
> <giuseppesantoro87 at gmail.com> wrote:
> > Hi Pidgin Developers,
> >
> > I'm studying libpurple and pidgin to give my contribution in this
> project.
> >
> > I have a question:
> >
> > if I have a PurpleBuddy, how do I get his state?
> > I tried this code but state is ever "OFFLINE":
> >
> >             presence = purple_buddy_get_presence(buddy);
> >             status = purple_presence_get_active_status(presence);
> >             printf("%s\n", purple_status_get_name(status));
> >
> > where am I wrong?
>
> That looks correct to me.  Are you sure you're using the right buddy
> object?  Are you sure the buddy is online?  Are you sure you're
> printing the status while the buddy is online?
>
> The PurpleStatus name is actually the PurpleStatusType name.  And the
> PurpleStatusType name comes from the prpl.  It's possible the prpl
> mistakenly sets the name of the status type to "OFFLINE."  You could
> try printing
> purple_primitive_get_id_from_type(purple_status_type_get_primitive(purple_status_get_type(status)))
> to verify that the status type really is offline.
>
> --Mark
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20100315/177515f9/attachment-0001.html>


More information about the Devel mailing list