All buddies are offline
Nicholas Guarracino
nicholas.guarracino at ipc.com
Fri Aug 1 11:46:15 EDT 2008
On Fri, 2008-08-01 at 11:45 -0400, Sadrul Habib Chowdhury wrote:
> * Nicholas Guarracino had this to say on [01 Aug 2008, 11:21:54 -0400]:
> > I'm just starting a basic libpurple client and I'm having trouble with
> > all of my buddies showing Offline. This is what I'm doing in my "show"
> > callback within PurpleBlistUiOps. Does it seem right or am I missing
> > something?
> >
> > static void show_buddies (PurpleBuddyList * buddy_list)
> > {
> > syslog (LOG_INFO, "show_buddies");
> >
> > PurpleBlistNode * buddy_node = purple_blist_get_root();
> > while (buddy_node)
> > {
> > if (!PURPLE_BLIST_NODE_IS_BUDDY (buddy_node)) continue;
> >
> > const PurpleBuddy * buddy = (PurpleBuddy*) (buddy_node);
> > PurplePresence * pres = purple_buddy_get_presence (buddy);
> > PurpleStatus * status = purple_presence_get_active_status (pres);
> > syslog (LOG_INFO, "\tStatus: %s", purple_status_get_name (status));
> > }
> > buddy_node = purple_blist_node_next (buddy_node, TRUE);
>
> Your loop is incorrect. You need to advance buddy_node within the loop
> (also before continue-ing from the first check within the loop). A for
> loop is usually better in such cases.
Sorry, you're right. When I copied & pasted the code, I edited it a bit
so it wouldn't wrap and in the process I obviously overlooked a couple
things. In my original code, the loop itself works properly. I do see
all of my buddies, but they are all Offline.
> [snip annoying Disclaimer notice]
Yes, my apologies about that (and the one at the bottom of this message
too!) It's quite embarrassing but it's out of my control :-(
DISCLAIMER:
Important Notice *************************************************
This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unintended recipients are prohibited from taking action on the basis of information in this e-mail.E-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be intercepted, deleted or interfered with without the knowledge of the sender or the intended recipient. If you are not comfortable with the risks associated with e-mail messages, you may decide not to use e-mail to communicate with IPC. IPC reserves the right, to the extent and under circumstances permitted by applicable law, to retain, monitor and intercept e-mail messages to and from its systems.
More information about the Devel
mailing list