get online / offline status of buddies

sandeep sandeep at konstantinfo.com
Fri May 14 10:09:50 EDT 2010


Hello,

We are getting problem to get online / offline status of buddies using below 
this code...

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


int show_buddy_list_from_active_accounts()
{
    FILE *out;
	GList *accounts = purple_accounts_get_all_active();
	
	
	sprintf(cwd, "%s%s", folder, "contact.txt");	
	
	out = fopen(cwd, "a" );
	
	printf("\n%s", "Loading....");
	
    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("%s|%s|%s\n", purple_buddy_get_alias(b), purple_buddy_get_name(b), 
purple_status_get_name(s));  

            //printf("\n%s", 
purple_primitive_get_id_from_type(purple_status_type_get_primitive(purple_status_get_type(s)))); 
            if( out != NULL )
             fprintf(out, "%s|%s|%s\n", purple_buddy_get_alias(b), 
purple_buddy_get_name(b), purple_status_get_name(s));
        }
    }

 fclose(out);
 return 1;

}

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

It was working earlier... please someone suggest why this is not working now?

Regards,
Sandeep Verma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20100514/7c5345d4/attachment.html>


More information about the Devel mailing list