# HG changeset patch # User Luke Schierer # Date 1095728419 0 # Node ID 5d2a08d82e7a28021e9507875a25026acccd144c # Parent b566449d45f8388f6808b10cc015284c2644eacb [gaim-migrate @ 11022] (20:52:20) nosnilmot: I also have a patch that makes MSN status stuff better (21:00:20) LSchiere: and the other? (21:00:57) nosnilmot: "bleh, I made it compile and work earlier, this might work a bit better and mean something now that I can test it" committer: Tailor Script diff -r b566449d45f8 -r 5d2a08d82e7a src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Tue Sep 21 00:58:41 2004 +0000 +++ b/src/protocols/msn/msn.c Tue Sep 21 01:00:19 2004 +0000 @@ -404,7 +404,8 @@ else if (gaim_presence_is_status_active(presence, "busy") || gaim_presence_is_status_active(presence, "phone")) emblems[i++] = "occupied"; - else if (gaim_presence_is_status_active(presence, "away")) + else if (gaim_presence_is_status_active(presence, "away") || + gaim_presence_is_idle(presence)) emblems[i++] = "away"; if (user == NULL) @@ -423,20 +424,36 @@ static char * msn_status_text(GaimBuddy *buddy) { - GString *s; GaimPresence *presence; GaimStatus *status; - MsnUser *user; - s = g_string_new(""); - user = buddy->proto_data; presence = gaim_buddy_get_presence(buddy); status = gaim_presence_get_active_status(presence); - if (!gaim_status_is_available(status)) + if (!gaim_presence_is_available(presence) && !gaim_presence_is_idle(presence)) + { + return g_strdup(gaim_status_get_name(status)); + } + + return NULL; +} + +static char * +msn_tooltip_text(GaimBuddy *buddy) +{ + MsnUser *user; + GaimPresence *presence = gaim_buddy_get_presence(buddy); + GaimStatus *status = gaim_presence_get_active_status(presence); + GString *s; + + user = buddy->proto_data; + + s = g_string_new(""); + if (gaim_presence_is_online(presence)) { g_string_append_printf(s, _("\n%s: %s"), _("Status"), - gaim_status_get_name(status)); + gaim_presence_is_idle(presence) ? + _("Idle") : gaim_status_get_name(status)); } g_string_append_printf(s, _("\n%s: %s"), _("Has you"), @@ -446,43 +463,22 @@ return g_string_free(s, FALSE); } -static char * -msn_tooltip_text(GaimBuddy *buddy) -{ - GaimPresence *presence = gaim_buddy_get_presence(buddy); - GaimStatus *status = gaim_presence_get_active_status(presence); - char *text = NULL; - - if (gaim_presence_is_online(presence)) - { - text = g_strdup_printf(_("\n%s: %s"), _("Status"), - gaim_status_get_name(status)); - } - - return text; -} - static GList * msn_status_types(GaimAccount *account) { GaimStatusType *status; GList *types = NULL; - status = gaim_status_type_new(GAIM_STATUS_OFFLINE, - "offline", _("Offline"), FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, + "offline", _("Offline"), FALSE, FALSE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new(GAIM_STATUS_ONLINE, - "online", _("Online"), FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_ONLINE, + "online", _("Online"), FALSE, FALSE, FALSE); types = g_list_append(types, status); status = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, - "available", _("Available"), FALSE, FALSE, FALSE); - types = g_list_append(types, status); - - status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, - "unavailable", _("Unavailable"), - FALSE, FALSE, FALSE); + "available", _("Available"), FALSE, TRUE, FALSE); types = g_list_append(types, status); status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "away", diff -r b566449d45f8 -r 5d2a08d82e7a src/protocols/msn/notification.c --- a/src/protocols/msn/notification.c Tue Sep 21 00:58:41 2004 +0000 +++ b/src/protocols/msn/notification.c Tue Sep 21 01:00:19 2004 +0000 @@ -495,11 +495,6 @@ if (!g_ascii_strcasecmp(state, "BSY")) status = "busy"; - else if (!g_ascii_strcasecmp(state, "IDL")) - { - /* XXX - Do something about idle time? */ - status = "idle"; - } else if (!g_ascii_strcasecmp(state, "BRB")) status = "brb"; else if (!g_ascii_strcasecmp(state, "AWY")) @@ -512,6 +507,11 @@ status = "available"; gaim_prpl_got_user_status(account, passport, status, NULL); + + if (!g_ascii_strcasecmp(state, "IDL")) + gaim_prpl_got_user_idle(account, passport, TRUE, -1); + else + gaim_prpl_got_user_idle(account, passport, FALSE, 0); } static void @@ -573,11 +573,6 @@ if (!g_ascii_strcasecmp(state, "BSY")) status = "busy"; - else if (!g_ascii_strcasecmp(state, "IDL")) - { - /* XXX - Do something about idle time? */ - status = "idle"; - } else if (!g_ascii_strcasecmp(state, "BRB")) status = "brb"; else if (!g_ascii_strcasecmp(state, "AWY")) @@ -590,6 +585,11 @@ status = "available"; gaim_prpl_got_user_status(account, passport, status, NULL); + + if (!g_ascii_strcasecmp(state, "IDL")) + gaim_prpl_got_user_idle(account, passport, TRUE, -1); + else + gaim_prpl_got_user_idle(account, passport, FALSE, 0); } static void