problem to get status of buddies

Sadrul Habib Chowdhury imadil at gmail.com
Wed May 5 10:17:20 EDT 2010


The same question has been asked and answered before:
http://pidgin.im/pipermail/devel/2010-March/009311.html

Cheers.
Sadrul

* sandeep at konstantinfo.com had this to say on [05 May 2010, 18:45:42 +0530]:
> 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
> 
>  
> 

> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel




More information about the Devel mailing list