Mercurial > pidgin
changeset 17674:e24d44e3b6d2
Recognize online/away status of buddies on buddy list.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Mon, 02 Jul 2007 01:45:30 +0000 |
parents | d125c3562280 |
children | a752e1017fe9 |
files | libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h |
diffstat | 2 files changed, 18 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c Sun Jul 01 23:33:27 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Jul 02 01:45:30 2007 +0000 @@ -1736,12 +1736,20 @@ /* Set user status */ switch (status_code) { - case 1: purple_status_code = PURPLE_STATUS_AVAILABLE; - break; - case 0: purple_status_code = PURPLE_STATUS_OFFLINE; - break; + case MSIM_STATUS_CODE_OFFLINE: + purple_status_code = PURPLE_STATUS_OFFLINE; + break; + + case MSIM_STATUS_CODE_ONLINE: + purple_status_code = PURPLE_STATUS_AVAILABLE; + break; + + case MSIM_STATUS_CODE_AWAY: + purple_status_code = PURPLE_STATUS_AWAY; + break; + default: - purple_debug_info("msim", "msim_status_cb for %s, unknown status code %d\n", + purple_debug_info("msim", "msim_status_cb for %s, unknown status code %d, treating as available\n", username, status_code); purple_status_code = PURPLE_STATUS_AVAILABLE; }
--- a/libpurple/protocols/myspace/myspace.h Sun Jul 01 23:33:27 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Mon Jul 02 01:45:30 2007 +0000 @@ -129,6 +129,11 @@ #define MSIM_STATUS_ORDINAL_UNKNOWNp 8 #define MSIM_STATUS_ORDINAL_UNKNOWN2 9 +/* Status codes - states a buddy (or you!) can be in. */ +#define MSIM_STATUS_CODE_OFFLINE 0 /* or hidden */ +#define MSIM_STATUS_CODE_ONLINE 1 +#define MSIM_STATUS_CODE_AWAY 5 + /* Random number in every MsimSession, to ensure it is valid. */ #define MSIM_SESSION_STRUCT_MAGIC 0xe4a6752b