problem to get status of buddies

sandeep at konstantinfo.com sandeep at konstantinfo.com
Wed May 5 09:15:42 EDT 2010


Hello Support,

 

We are using nullclient.c for libpurple to get contacts of account...

 

but there is some problem to get status of buddies.. we are using code
below...

 

......................................................

 

 

static void

show_buddy_list_from_active_accounts()

{

    GList *accounts = purple_accounts_get_all_active();

    for (; accounts; accounts = g_list_delete_link(accounts, accounts)) {

        GSList *buddies = purple_find_buddies(accounts->data, NULL);

        for (; buddies; buddies = g_slist_delete_link(buddies,buddies)) {

            PurpleBuddy *b = buddies->data;

            PurplePresence *p = purple_buddy_get_presence(b);

            PurpleStatus *s = purple_presence_get_active_status(p);

              

 

            //printf("\n%s",
purple_primitive_get_id_from_type(purple_status_type_get_primitive(purple_st
atus_get_type(s)))); 

  

            printf("status = %s  buddy = %s\n",

                    purple_status_get_name(s),

                    purple_buddy_get_name(b));

        }

    }

}

 

 

 

static void

signed_on(PurpleConnection *gc, gpointer null)

{

        PurpleAccount *account = purple_connection_get_account(gc);

        printf("Account connected: %s %s\n", account->username,
account->protocol_id);

        

        //printf("%s\n", "verma"); 

           

           sleep(10);

 

        purple_accounts_add(account);

        show_buddy_list_from_active_accounts();

 

        listaContatos(); //exit(0);

}

 

 

..............................................................

 

 

[root at COMP63 nullclient]# ./presense 15 ompriamapi at gmail.com ******

Account connected: ompriamapi at gmail.com prpl-jabber

 

status = Offline  buddy = testprojectsnow at gmail.com

status = Offline  buddy = no-reply at groovetap.com

 

here you can see buddies always Offline.. please suggest what solution we
need to use?

 

 

Thanks for your understanding...

 

Regards,

Sandeep Verma

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20100505/cbef1b87/attachment-0001.html>


More information about the Devel mailing list