Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7620551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:58:02+00:00 2026-05-31T03:58:02+00:00

I’m trying to pull the current status of another person on a SIMPLE network

  • 0

I’m trying to pull the current status of another person on a SIMPLE network (Microsoft Office Communicator). I’m using libpurple, built a c++ wrapper around libpurple, and I can send/receive IMs with other users on the SIMPLE network. What I still need is to get the current status of other users

Here’s my current attempt at retrieving status of another user.
Previously defined and initialized:

PurpleAccount *CommonIM::m_account -> I can send messages using this account

// the username of the person I want to get the status of, e.g. 
username = "sip:blah@blah.blah.com";

//TEST instance 1
PurpleBuddy* newbody1 = purple_buddy_new(m_account, username.c_str(), NULL);
sleep(5);
PurplePresence *p1 = purple_buddy_get_presence(newbody1);

PurpleStatus *status1 = purple_presence_get_active_status(p1);
PurpleStatusType *statusType1 = purple_status_get_type(status1);
PurpleStatusPrimitive prim1 = purple_status_type_get_primitive(statusType1);

switch(prim1)
{
case PURPLE_STATUS_UNSET:
{
    status = "unset";
}
break;
case PURPLE_STATUS_OFFLINE:
{
    status = "offline";
}
break;
case PURPLE_STATUS_AVAILABLE:
{
    status = "available";
}
break;
case PURPLE_STATUS_UNAVAILABLE:
{
    status = "unavailable";
}
break;
case PURPLE_STATUS_INVISIBLE:
{
    status = "invisible";
}
break;
case PURPLE_STATUS_AWAY:
{
    status = "away";
}
break;
case PURPLE_STATUS_EXTENDED_AWAY:
{
    status = "extended away";
}
break;
case PURPLE_STATUS_MOBILE:
{
    status = "mobile";
}
break;
case PURPLE_STATUS_TUNE:
{
    status = "tune";
}
break;
case PURPLE_STATUS_NUM_PRIMITIVES:
default:
{
    status = "unknown";
}
break;
}

//TEST instance 1 complete
cout << _TAG << "Test instance 1: Status for " << username << " is reported as " << status << endl;

This code always returns offline as the status. It’s as if purple doesn’t refresh the buddy after creating a new instance, it always remains as “offline”. I’ve dived into libpurple and pidgin to try to find this for the past few days but can’t find the ‘proper’ way of retrieving status.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:58:03+00:00Added an answer on May 31, 2026 at 3:58 am

    For some reason, calling this from the signed-on signal doesn’t work.

    Calling it from the buddy-signed-on signal works for me. Of course, in that case it will be called once for each signed-on buddy …

    sample function to be called from the “buddy-signed-on” signal:

    static void buddy_signed_on(PurpleBuddy *buddy) {
    GSList *buddies = purple_blist_get_buddies();
    for(; buddies; buddies = buddies->next) {
        PurpleBuddy *b = (PurpleBuddy *) buddies->data;
        PurplePresence *presence = purple_buddy_get_presence(b);
        PurpleStatus *status = purple_presence_get_active_status(presence);
        printf("%s is now %s\n", b->name, purple_status_get_id(status));
        }
    }
    

    Connect the signal:

    purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", &handle,
              PURPLE_CALLBACK(buddy_signed_on), NULL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.