Mercurial > pidgin.yaz
changeset 12595:3169cd6727ad
[gaim-migrate @ 14925]
I've been meaning to spend the time to commit these changes separately, but it's been a couple days without me finding the time...
1. Allow the creation of GaimStatusTypes by passing NULL for the name and/or id. The core uses the default name and/or id. This eliminates quite a bit of duplication in the prpls.
2. Make statuses more consistent. For example, in some prpls, "Busy" was descended from the UNAVAILABLE primitive and on others it was a case of AWAY. Another example... "On Vacation" is definitely an EXTENDED_AWAY not an AWAY.
3. Rename some pixmaps to elminate some special cases. The names of the pixmaps should now match the primitive default IDs.
4. Rename the HIDDEN primitive to INVISIBLE, since we seem to be using that term everywhere. In conjunction with #1, more duplication was eliminated.
5. Add a MOBILE status primitive. It's not used now. It'll be needed in the (hopefully not-too-distant) future, so I'm planning ahead.
6. Shrink the status select for small blist folks. Now if someone can get rid of that stupid extra padding, we'll be set (well, after we deal with imhtml space issues). I've fought with this for many many hours over several days and I can't get it. It's clear that the combo box is requesting more space than is really necessary, but I don't know why.
This is really my first go at anything significant status-related. Everyone should check their favorite prpls carefully to make sure I didn't break anything.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 21 Dec 2005 08:24:17 +0000 |
parents | 3d34460ecfd6 |
children | 037a673ba862 |
files | pixmaps/status/default/Makefile.am pixmaps/status/default/extended_away.png pixmaps/status/default/extendedaway.png pixmaps/status/default/na.png pixmaps/status/default/unavailable.png plugins/ChangeLog.API plugins/contact_priority.c src/gtkstatusbox.c src/gtkstock.c src/gtkstock.h src/gtkutils.c src/protocols/bonjour/bonjour.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/novell/novell.c src/protocols/oscar/oscar.c src/protocols/sametime/sametime.c src/protocols/silc/silc.c src/protocols/simple/simple.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/status.c src/status.h |
diffstat | 26 files changed, 289 insertions(+), 207 deletions(-) [+] |
line wrap: on
line diff
--- a/pixmaps/status/default/Makefile.am Wed Dec 21 07:59:45 2005 +0000 +++ b/pixmaps/status/default/Makefile.am Wed Dec 21 08:24:17 2005 +0000 @@ -7,7 +7,7 @@ blocked.png \ bonjour.png \ dnd.png \ - extendedaway.png \ + extended_away.png \ external.png \ female.png \ founder.png \ @@ -26,7 +26,6 @@ male.png \ meanwhile.png \ msn.png \ - na.png \ napster.png \ notauthorized.png \ novell.png \ @@ -37,6 +36,7 @@ secure.png \ silc.png \ simple.png \ + unavailable.png \ voice.png \ wireless.png \ yahoo.png \
--- a/plugins/ChangeLog.API Wed Dec 21 07:59:45 2005 +0000 +++ b/plugins/ChangeLog.API Wed Dec 21 08:24:17 2005 +0000 @@ -25,6 +25,8 @@ * gaim_conv_window_remove_conversation()'s last argument to be a GaimConversation. * A new blocked icon: pixmaps/status/default/blocked.png + * In pixmaps/status/default: extendedaway.png renamed to extended_away.png + * In pixmaps/status/default: na.png renamed to unavailable.png * gtk_imhtml_toggle_bold(): No longer returns a value * gtk_imhtml_toggle_italic(): No longer returns a value * gtk_imhtml_toggle_underline(): No longer returns a value
--- a/plugins/contact_priority.c Wed Dec 21 07:59:45 2005 +0000 +++ b/plugins/contact_priority.c Wed Dec 21 08:24:17 2005 +0000 @@ -61,6 +61,10 @@ { "idle", N_("Buddy is idle") }, { "away", N_("Buddy is away") }, { "extended_away", N_("Buddy is \"extended\" away") }, +#if 0 + /* Not used yet. */ + { "mobile", N_("Buddy is mobile") }, +#endif { "offline", N_("Buddy is offline") }, { NULL, NULL } };
--- a/src/gtkstatusbox.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/gtkstatusbox.c Wed Dec 21 08:24:17 2005 +0000 @@ -344,7 +344,7 @@ update_to_reflect_current_status(GtkGaimStatusBox *status_box) { GaimSavedStatus *saved_status; - GaimStatusPrimitive primitive; + guint index; const char *message; /* this function is inappropriate for ones with accounts */ @@ -359,26 +359,30 @@ */ gtk_widget_set_sensitive(GTK_WIDGET(status_box), FALSE); - primitive = gaim_savedstatus_get_type(saved_status); - if (gaim_savedstatus_has_substatuses(saved_status) || - ((primitive != GAIM_STATUS_AVAILABLE) && - (primitive != GAIM_STATUS_OFFLINE) && - (primitive != GAIM_STATUS_AWAY) && - (primitive != GAIM_STATUS_HIDDEN))) - { - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 5); - } + if (gaim_savedstatus_has_substatuses(saved_status)) + index = 5; else { - if (primitive == GAIM_STATUS_AVAILABLE) - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 0); - if (primitive == GAIM_STATUS_OFFLINE) - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 3); - else if (primitive == GAIM_STATUS_AWAY) - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 1); - else if (primitive == GAIM_STATUS_HIDDEN) - gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 2); + switch (gaim_savedstatus_get_type(saved_status)) + { + case GAIM_STATUS_AVAILABLE: + index = 0; + break; + case GAIM_STATUS_AWAY: + index = 1; + break; + case GAIM_STATUS_INVISIBLE: + index = 2; + break; + case GAIM_STATUS_OFFLINE: + index = 3; + break; + default: + index = 5; + break; + } } + gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), index); message = gaim_savedstatus_get_message(saved_status); if (!message || !*message) @@ -416,7 +420,10 @@ GdkPixbuf *pixbuf, *pixbuf2, *pixbuf3, *pixbuf4; GtkIconSize icon_size; - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); + if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); + else + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); /* Unset the model while clearing it */ gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), NULL); @@ -437,7 +444,7 @@ /* hacks */ gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GAIM_STATUS_AVAILABLE, pixbuf, _("Available"), NULL); gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GAIM_STATUS_AWAY, pixbuf2, _("Away"), NULL); - gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GAIM_STATUS_HIDDEN, pixbuf4, _("Invisible"), NULL); + gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GAIM_STATUS_INVISIBLE, pixbuf4, _("Invisible"), NULL); gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GAIM_STATUS_OFFLINE, pixbuf3, _("Offline"), NULL); gtk_gaim_status_box_add_separator(GTK_GAIM_STATUS_BOX(status_box)); gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), GTK_GAIM_STATUS_BOX_TYPE_CUSTOM, pixbuf, _("Custom..."), NULL); @@ -511,6 +518,60 @@ #endif static void +cache_pixbufs(GtkGaimStatusBox *status_box) +{ + GtkIconSize icon_size; + + if (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_TWO_LINE); + else + icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE); + + if (status_box->error_pixbuf != NULL) + gdk_pixbuf_unref(status_box->error_pixbuf); + + status_box->error_pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_OFFLINE, + icon_size, "GtkGaimStatusBox"); + if (status_box->connecting_pixbufs[0] != NULL) + gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); + if (status_box->connecting_pixbufs[1] != NULL) + gdk_pixbuf_unref(status_box->connecting_pixbufs[1]); + if (status_box->connecting_pixbufs[2] != NULL) + gdk_pixbuf_unref(status_box->connecting_pixbufs[2]); + if (status_box->connecting_pixbufs[3] != NULL) + gdk_pixbuf_unref(status_box->connecting_pixbufs[3]); + + status_box->connecting_index = 0; + status_box->connecting_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT0, + icon_size, "GtkGaimStatusBox"); + status_box->connecting_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT1, + icon_size, "GtkGaimStatusBox"); + status_box->connecting_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT2, + icon_size, "GtkGaimStatusBox"); + status_box->connecting_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT3, + icon_size, "GtkGaimStatusBox"); + + if (status_box->typing_pixbufs[0] != NULL) + gdk_pixbuf_unref(status_box->typing_pixbufs[0]); + if (status_box->typing_pixbufs[1] != NULL) + gdk_pixbuf_unref(status_box->typing_pixbufs[1]); + if (status_box->typing_pixbufs[2] != NULL) + gdk_pixbuf_unref(status_box->typing_pixbufs[2]); + if (status_box->typing_pixbufs[3] != NULL) + gdk_pixbuf_unref(status_box->typing_pixbufs[3]); + + status_box->typing_index = 0; + status_box->typing_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING0, + icon_size, "GtkGaimStatusBox"); + status_box->typing_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING1, + icon_size, "GtkGaimStatusBox"); + status_box->typing_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING2, + icon_size, "GtkGaimStatusBox"); + status_box->typing_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING3, + icon_size, "GtkGaimStatusBox"); +} + +static void current_status_pref_changed_cb(const char *name, GaimPrefType type, gpointer val, gpointer data) { @@ -522,6 +583,16 @@ update_to_reflect_current_status(box); } +static void +buddy_list_details_pref_changed_cb(const char *name, GaimPrefType type, + gpointer val, gpointer data) +{ + GtkGaimStatusBox *status_box = (GtkGaimStatusBox *)data; + + cache_pixbufs(status_box); + gtk_gaim_status_box_regenerate(status_box); +} + #if 0 static gboolean button_released_cb(GtkWidget *widget, GdkEventButton *event, GtkGaimStatusBox *box) { @@ -561,11 +632,9 @@ GtkCellRenderer *icon_rend; GtkTextBuffer *buffer; GtkTreePath *path; - GtkIconSize icon_size; text_rend = gtk_cell_renderer_text_new(); icon_rend = gtk_cell_renderer_pixbuf_new(); - icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); status_box->imhtml_visible = FALSE; status_box->connecting = FALSE; @@ -652,36 +721,17 @@ G_CALLBACK(scroll_event_cb), status_box->imhtml); #if GTK_CHECK_VERSION(2,6,0) - gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(status_box), dropdown_store_row_separator_func, NULL, NULL); + gtk_combo_box_set_row_separator_func(GTK_COMBO_BOX(status_box), dropdown_store_row_separator_func, NULL, NULL); #endif - status_box->error_pixbuf = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_OFFLINE, - icon_size, "GtkGaimStatusBox"); - status_box->connecting_index = 0; - status_box->connecting_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT0, - icon_size, "GtkGaimStatusBox"); - status_box->connecting_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT1, - icon_size, "GtkGaimStatusBox"); - status_box->connecting_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT2, - icon_size, "GtkGaimStatusBox"); - status_box->connecting_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_CONNECT3, - icon_size, "GtkGaimStatusBox"); - - status_box->typing_index = 0; - status_box->typing_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING0, - icon_size, "GtkGaimStatusBox"); - status_box->typing_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING1, - icon_size, "GtkGaimStatusBox"); - status_box->typing_pixbufs[2] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING2, - icon_size, "GtkGaimStatusBox"); - status_box->typing_pixbufs[3] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), GAIM_STOCK_STATUS_TYPING3, - icon_size, "GtkGaimStatusBox"); - + cache_pixbufs(status_box); gtk_gaim_status_box_regenerate(status_box); - /* Monitor changes in the "/core/savedstatus/current" preference */ gaim_prefs_connect_callback(status_box, "/core/savedstatus/current", current_status_pref_changed_cb, status_box); + gaim_prefs_connect_callback(status_box, "/gaim/gtk/blist/show_buddy_icons", + buddy_list_details_pref_changed_cb, status_box); + } static void @@ -715,7 +765,7 @@ box_alc = *allocation; combo_box_size_request(widget, &req); - box_alc.height = MAX(1, ((allocation->height) - (req.height) - (12))); + box_alc.height = MAX(1, (allocation->height - req.height - 12)); box_alc.y = box_alc.y + req.height + 9; box_alc.width -= 6;
--- a/src/gtkstock.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/gtkstock.c Wed Dec 21 08:24:17 2005 +0000 @@ -272,6 +272,9 @@ gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90); gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60); gtk_icon_size_register(GAIM_ICON_SIZE_STATUS, 30, 30); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_TWO_LINE, 30, 30); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL, 16, 16); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE, 24, 24); g_object_unref(G_OBJECT(icon_factory));
--- a/src/gtkstock.h Wed Dec 21 07:59:45 2005 +0000 +++ b/src/gtkstock.h Wed Dec 21 08:24:17 2005 +0000 @@ -102,9 +102,12 @@ /** * For using icons that aren't one of the default GTK_ICON_SIZEs */ -#define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool" -#define GAIM_ICON_SIZE_LOGO "gaim-icon-size-logo" -#define GAIM_ICON_SIZE_STATUS "gaim-icon-size-status" +#define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool" +#define GAIM_ICON_SIZE_LOGO "gaim-icon-size-logo" +#define GAIM_ICON_SIZE_STATUS "gaim-icon-size-status" +#define GAIM_ICON_SIZE_STATUS_TWO_LINE "gaim-icon-size-status-two-line" +#define GAIM_ICON_SIZE_STATUS_SMALL "gaim-icon-size-status-small" +#define GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE "gaim-icon-size-status-small-two-line" /** * Sets up the gaim stock repository.
--- a/src/gtkutils.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/gtkutils.c Wed Dec 21 08:24:17 2005 +0000 @@ -1599,10 +1599,7 @@ /* TODO: let the prpl pick the emblem on a per status basis, and only * use the primitive as a fallback */ type_name = gaim_primitive_get_id_from_type(gaim_status_type_get_primitive(status_type)); - if (!strcmp(type_name, "hidden")) - type_name = "invisible"; - else if (!strcmp(type_name, "unavailable")) - type_name = "na"; + g_snprintf(basename2, sizeof(basename2), "%s.png", type_name); filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default",
--- a/src/protocols/bonjour/bonjour.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/bonjour/bonjour.c Wed Dec 21 08:24:17 2005 +0000 @@ -243,19 +243,19 @@ type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, BONJOUR_STATUS_ID_OFFLINE, - _("Offline"), TRUE, TRUE, FALSE); + NULL, TRUE, TRUE, FALSE); status_types = g_list_append(status_types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, BONJOUR_STATUS_ID_AVAILABLE, - _("Available"), TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, BONJOUR_STATUS_ID_AWAY, - _("Away"), TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); @@ -269,11 +269,13 @@ GaimBuddy *buddy = gaim_find_buddy(connection->account, who); if (buddy == NULL) + { /* * This buddy is not in our buddy list, and therefore does not really * exist, so we won't have any data about them. */ return; + } bonjour_jabber_close_conversation(((BonjourData*)(connection->proto_data))->jabber_data, buddy); } @@ -281,7 +283,7 @@ static void bonjour_list_emblems(GaimBuddy *buddy, const char **se, const char **sw, - const char **nw,const char **ne) + const char **nw, const char **ne) { GaimPresence *presence;
--- a/src/protocols/gg/gg.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/gg/gg.c Wed Dec 21 08:24:17 2005 +0000 @@ -1343,23 +1343,19 @@ * The only valid status types are those defined * in prpl_info->status_types. * - * Usable icons: away, blocked, dnd, extendedaway, + * Usable icons: away, blocked, dnd, extended_away, * freeforchat, ignored, invisible, na, offline. */ if (!GAIM_BUDDY_IS_ONLINE(b)) { *se = "offline"; - } else if (gaim_presence_is_status_active(presence, "away")) { + } else if (gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY)) { *se = "away"; - } else if (gaim_presence_is_status_active(presence, "available")) { - *se = "online"; - } else if (gaim_presence_is_status_active(presence, "offline")) { - *se = "offline"; } else if (gaim_presence_is_status_active(presence, "blocked")) { *se = "blocked"; } else { *se = "offline"; - gaim_debug_info("gg", "ggp_list_emblems: unknown status\n"); + gaim_debug_error("gg", "ggp_list_emblems: unknown status\n"); } } /* }}} */ @@ -1428,33 +1424,38 @@ GaimStatusType *type; GList *types = NULL; - type = gaim_status_type_new_with_attrs(GAIM_STATUS_OFFLINE, "offline", - _("Offline"), TRUE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs( + GAIM_STATUS_OFFLINE, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available", - _("Available"), TRUE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs( + GAIM_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); /* * Without this selecting Invisible as own status doesn't * work. It's not used and not needed to show status of buddies. */ - type = gaim_status_type_new_with_attrs(GAIM_STATUS_HIDDEN, "invisible", - _("Invisible"), TRUE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs( + GAIM_STATUS_INVISIBLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, "away", - _("Busy"), TRUE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, "busy", _("Busy"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_HIDDEN, "blocked", - _("Blocked"), TRUE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + /* Why is blocked a status??? -- rlaager */ + type = gaim_status_type_new_with_attrs( + GAIM_STATUS_INVISIBLE, "blocked", _("Blocked"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); return types;
--- a/src/protocols/irc/irc.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/irc/irc.c Wed Dec 21 08:24:17 2005 +0000 @@ -163,17 +163,16 @@ GaimStatusType *type; GList *types = NULL; - type = gaim_status_type_new(GAIM_STATUS_OFFLINE, "offline", - _("Offline"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_OFFLINE, NULL, NULL, TRUE); types = g_list_append(types, type); - type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, "available", - _("Available"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, NULL, NULL, TRUE); types = g_list_append(types, type); type = gaim_status_type_new_with_attrs( - GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); + GAIM_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); return types;
--- a/src/protocols/jabber/jabber.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/jabber/jabber.c Wed Dec 21 08:24:17 2005 +0000 @@ -964,11 +964,10 @@ *se = "offline"; } else { GaimStatusType *status_type = gaim_status_get_type(gaim_presence_get_active_status(gaim_buddy_get_presence(b))); + GaimStatusPrimitive primitive = gaim_status_type_get_primitive(status_type); - if(gaim_status_type_get_primitive(status_type) > GAIM_STATUS_AVAILABLE) { + if(primitive > GAIM_STATUS_AVAILABLE) { *se = gaim_status_type_get_id(status_type); - if(!strcmp(*se, "xa")) - *se = "extendedaway"; } } } @@ -1083,49 +1082,61 @@ GList *types = NULL; GaimValue *priority_value; - type = gaim_status_type_new_with_attrs(GAIM_STATUS_OFFLINE, "offline", - _("Offline"), FALSE, TRUE, FALSE, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_OFFLINE, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_UNAVAILABLE), + NULL, FALSE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); priority_value = gaim_value_new(GAIM_TYPE_INT); gaim_value_set_int(priority_value, 1); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available", - _("Available"), TRUE, TRUE, FALSE, "priority", _("Priority"), - priority_value, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_ONLINE), + NULL, TRUE, TRUE, FALSE, + "priority", _("Priority"), priority_value, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); priority_value = gaim_value_new(GAIM_TYPE_INT); gaim_value_set_int(priority_value, 1); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "chat", - _("Chatty"), TRUE, TRUE, FALSE, "priority", _("Priority"), - priority_value, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_CHAT), + _("Chatty"), TRUE, TRUE, FALSE, + "priority", _("Priority"), priority_value, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); priority_value = gaim_value_new(GAIM_TYPE_INT); gaim_value_set_int(priority_value, 0); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, "away", - _("Away"), TRUE, TRUE, FALSE, "priority", _("Priority"), - priority_value, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_AWAY), + NULL, TRUE, TRUE, FALSE, + "priority", _("Priority"), priority_value, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); priority_value = gaim_value_new(GAIM_TYPE_INT); gaim_value_set_int(priority_value, 0); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_EXTENDED_AWAY, "xa", - _("Extended Away"), TRUE, TRUE, FALSE, "priority", _("Priority"), - priority_value, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_EXTENDED_AWAY, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_XA), + NULL, TRUE, TRUE, FALSE, + "priority", _("Priority"), priority_value, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); priority_value = gaim_value_new(GAIM_TYPE_INT); gaim_value_set_int(priority_value, 0); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, "dnd", - _("Do Not Disturb"), TRUE, TRUE, FALSE, "priority", _("Priority"), - priority_value, "message", _("Message"), - gaim_value_new(GAIM_TYPE_STRING), NULL); + type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, + jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_DND), + _("Do Not Disturb"), TRUE, TRUE, FALSE, + "priority", _("Priority"), priority_value, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); /*
--- a/src/protocols/msn/msn.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/msn/msn.c Wed Dec 21 08:24:17 2005 +0000 @@ -574,35 +574,35 @@ GList *types = NULL; status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, - "offline", _("Offline"), FALSE, TRUE, FALSE); + NULL, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, status); status = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, - "available", _("Available"), FALSE, TRUE, FALSE); + NULL, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "away", - _("Away"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_AWAY, + NULL, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "brb", - _("Be Right Back"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_AWAY, + "brb", _("Be Right Back"), FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "busy", - _("Busy"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, + "busy", _("Busy"), FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "phone", - _("On the Phone"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, + "phone", _("On the Phone"), FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, "lunch", - _("Out to Lunch"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_AWAY, + "lunch", _("Out to Lunch"), FALSE, TRUE, FALSE); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_HIDDEN, "invisible", - _("Hidden"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, + NULL, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, status); return types;
--- a/src/protocols/napster/napster.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/napster/napster.c Wed Dec 21 08:24:17 2005 +0000 @@ -575,13 +575,11 @@ g_return_val_if_fail(account != NULL, NULL); type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, - "offline", - _("Offline"), TRUE, TRUE, FALSE); + NULL, NULL, TRUE, TRUE, FALSE); types = g_list_append(types, type); type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, - "available", - _("Available"), TRUE, TRUE, FALSE); + NULL, NULL, TRUE, TRUE, FALSE); types = g_list_append(types, type); return types;
--- a/src/protocols/novell/novell.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/novell/novell.c Wed Dec 21 08:24:17 2005 +0000 @@ -2972,29 +2972,29 @@ g_return_val_if_fail(account != NULL, NULL); - type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, "offline", _("Offline"), FALSE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, NULL, NULL, FALSE, TRUE, FALSE); status_types = g_list_append(status_types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, NOVELL_STATUS_TYPE_AVAILABLE, _("Available"), - TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, NOVELL_STATUS_TYPE_AVAILABLE, + NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, NOVELL_STATUS_TYPE_AWAY, _("Away"), - TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, NOVELL_STATUS_TYPE_AWAY, + NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); - type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, NOVELL_STATUS_TYPE_BUSY, _("Busy"), - TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + type = gaim_status_type_new_with_attrs(GAIM_STATUS_UNAVAILABLE, NOVELL_STATUS_TYPE_BUSY, + _("Busy"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); - type = gaim_status_type_new_full(GAIM_STATUS_HIDDEN, NOVELL_STATUS_TYPE_APPEAR_OFFLINE, _("Appear Offline"), - TRUE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, NOVELL_STATUS_TYPE_APPEAR_OFFLINE, + NULL, TRUE, TRUE, FALSE); status_types = g_list_append(status_types, type); return status_types; @@ -3041,7 +3041,7 @@ novellstatus = NM_STATUS_AWAY; } else if (primitive == GAIM_STATUS_UNAVAILABLE) { novellstatus = NM_STATUS_BUSY; - } else if (primitive == GAIM_STATUS_HIDDEN) { + } else if (primitive == GAIM_STATUS_INVISIBLE) { novellstatus = NM_STATUS_OFFLINE; } else if (gaim_presence_is_idle(presence)) { novellstatus = NM_STATUS_AWAY_IDLE;
--- a/src/protocols/oscar/oscar.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/oscar/oscar.c Wed Dec 21 08:24:17 2005 +0000 @@ -6527,7 +6527,7 @@ od = gc->proto_data; account = gaim_connection_get_account(gc); presence = gaim_account_get_presence(account); - invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_HIDDEN); + invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE); if (invisible) aim_setextstatus(od->sess, AIM_ICQ_STATE_INVISIBLE); @@ -6561,7 +6561,7 @@ status_type = gaim_status_get_type(status); primitive = gaim_status_type_get_primitive(status_type); presence = gaim_account_get_presence(account); - invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_HIDDEN); + invisible = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE); if (!setinfo) { @@ -6656,7 +6656,7 @@ if (!od) return; - if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_HIDDEN) + if (gaim_status_type_get_primitive(gaim_status_get_type(status)) == GAIM_STATUS_INVISIBLE) account->perm_deny = GAIM_PRIVACY_ALLOW_USERS; else account->perm_deny = GAIM_PRIVACY_DENY_USERS; @@ -7539,7 +7539,7 @@ else if (!strcmp(status_id, OSCAR_STATUS_ID_DND)) emblems[i++] = "dnd"; else if (!strcmp(status_id, OSCAR_STATUS_ID_NA)) - emblems[i++] = "na"; + emblems[i++] = "unavailable"; else if (!strcmp(status_id, OSCAR_STATUS_ID_OCCUPIED)) emblems[i++] = "occupied"; else if (!strcmp(status_id, OSCAR_STATUS_ID_AWAY)) @@ -7819,26 +7819,26 @@ /* Oscar-common status types */ type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, OSCAR_STATUS_ID_OFFLINE, - _("Offline"), TRUE, TRUE, FALSE); + NULL, TRUE, TRUE, FALSE); status_types = g_list_append(status_types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, OSCAR_STATUS_ID_AVAILABLE, - _("Available"), TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, OSCAR_STATUS_ID_AWAY, - _("Away"), TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); status_types = g_list_append(status_types, type); - type = gaim_status_type_new_full(GAIM_STATUS_HIDDEN, + type = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, OSCAR_STATUS_ID_INVISIBLE, - _("Invisible"), TRUE, TRUE, FALSE); + NULL, TRUE, TRUE, FALSE); status_types = g_list_append(status_types, type); if (aim_sn_is_icq(gaim_account_get_username(account)) == FALSE )
--- a/src/protocols/sametime/sametime.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/sametime/sametime.c Wed Dec 21 08:24:17 2005 +0000 @@ -3234,7 +3234,7 @@ GaimStatusType *type; type = gaim_status_type_new(GAIM_STATUS_OFFLINE, MW_STATE_OFFLINE, - _("Offline"), TRUE); + NULL, TRUE); types = g_list_append(types, type); type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, MW_STATE_ACTIVE, @@ -3244,7 +3244,7 @@ types = g_list_append(types, type); type = gaim_status_type_new(GAIM_STATUS_AWAY, MW_STATE_AWAY, - _("Away"), TRUE); + NULL, TRUE); gaim_status_type_add_attr(type, MW_STATE_MESSAGE, _("Message"), gaim_value_new(GAIM_TYPE_STRING)); types = g_list_append(types, type);
--- a/src/protocols/silc/silc.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/silc/silc.c Wed Dec 21 08:24:17 2005 +0000 @@ -44,15 +44,15 @@ GaimStatusType *type; GList *types = NULL; - type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, SILCGAIM_STATUS_ID_OFFLINE, _("Offline"), FALSE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, SILCGAIM_STATUS_ID_OFFLINE, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, type); - type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, SILCGAIM_STATUS_ID_AVAILABLE, _("Available"), FALSE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, SILCGAIM_STATUS_ID_AVAILABLE, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, type); type = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, SILCGAIM_STATUS_ID_HYPER, _("Hyper Active"), FALSE, TRUE, FALSE); types = g_list_append(types, type); - type = gaim_status_type_new_full(GAIM_STATUS_AWAY, SILCGAIM_STATUS_ID_AWAY, _("Away"), FALSE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_AWAY, SILCGAIM_STATUS_ID_AWAY, NULL, FALSE, TRUE, FALSE); types = g_list_append(types, type); - type = gaim_status_type_new_full(GAIM_STATUS_AWAY, SILCGAIM_STATUS_ID_BUSY, _("Busy"), FALSE, TRUE, FALSE); + type = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, SILCGAIM_STATUS_ID_BUSY, _("Busy"), FALSE, TRUE, FALSE); types = g_list_append(types, type); type = gaim_status_type_new_full(GAIM_STATUS_AWAY, SILCGAIM_STATUS_ID_INDISPOSED, _("Indisposed"), FALSE, TRUE, FALSE); types = g_list_append(types, type);
--- a/src/protocols/simple/simple.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/simple/simple.c Wed Dec 21 08:24:17 2005 +0000 @@ -247,13 +247,13 @@ GList *types = NULL; type = gaim_status_type_new_full( - GAIM_STATUS_OFFLINE, "offline", _("Offline"), TRUE, TRUE, FALSE); + GAIM_STATUS_OFFLINE, NULL, NULL, TRUE, TRUE, FALSE); types = g_list_append(types, type); type = gaim_status_type_new_with_attrs( - GAIM_STATUS_AVAILABLE, "available", _("Available"), - TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); + GAIM_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); return types;
--- a/src/protocols/yahoo/yahoo.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/yahoo/yahoo.c Wed Dec 21 08:24:17 2005 +0000 @@ -3199,17 +3199,17 @@ GaimStatusType *type; GList *types = NULL; - type = gaim_status_type_new(GAIM_STATUS_OFFLINE, YAHOO_STATUS_TYPE_OFFLINE, _("Offline"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_OFFLINE, YAHOO_STATUS_TYPE_OFFLINE, NULL, TRUE); types = g_list_append(types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, YAHOO_STATUS_TYPE_AVAILABLE, - "Available", TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_AWAY, - _("Away"), TRUE, TRUE, FALSE, + NULL, TRUE, TRUE, FALSE, "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); types = g_list_append(types, type); @@ -3217,7 +3217,7 @@ type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_BRB, _("Be Right Back"), TRUE); types = g_list_append(types, type); - type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_BUSY, _("Busy"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_UNAVAILABLE, YAHOO_STATUS_TYPE_BUSY, _("Busy"), TRUE); types = g_list_append(types, type); type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTATHOME, _("Not at Home"), TRUE); @@ -3229,10 +3229,10 @@ type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTINOFFICE, _("Not in Office"), TRUE); types = g_list_append(types, type); - type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_ONPHONE, _("On the Phone"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_UNAVAILABLE, YAHOO_STATUS_TYPE_ONPHONE, _("On the Phone"), TRUE); types = g_list_append(types, type); - type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_ONVACATION, _("On Vacation"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_EXTENDED_AWAY, YAHOO_STATUS_TYPE_ONVACATION, _("On Vacation"), TRUE); types = g_list_append(types, type); type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_OUTTOLUNCH, _("Out to Lunch"), TRUE); @@ -3242,7 +3242,7 @@ types = g_list_append(types, type); - type = gaim_status_type_new(GAIM_STATUS_HIDDEN, YAHOO_STATUS_TYPE_INVISIBLE, _("Invisible"), TRUE); + type = gaim_status_type_new(GAIM_STATUS_INVISIBLE, YAHOO_STATUS_TYPE_INVISIBLE, NULL, TRUE); types = g_list_append(types, type); return types;
--- a/src/protocols/zephyr/zephyr.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/protocols/zephyr/zephyr.c Wed Dec 21 08:24:17 2005 +0000 @@ -2199,17 +2199,17 @@ static void zephyr_set_status(GaimAccount *account, GaimStatus *status) { zephyr_account *zephyr = gaim_account_get_connection(account)->proto_data; - const char *status_id = gaim_status_get_id(status); + GaimStatusPrimitive primitive = gaim_status_type_get_primitive(gaim_status_get_type(status)); if (zephyr->away) { g_free(zephyr->away); zephyr->away=NULL; } - if (!strcmp(status_id,"away")) { + if (primitive == GAIM_STATUS_AWAY) { zephyr->away = g_strdup(gaim_status_get_attr_string(status,"message")); } - else if (!strcmp(status_id,"available")) { + else if (primitive == GAIM_STATUS_AVAILABLE) { if (use_zeph02(zephyr)) { ZSetLocation(zephyr->exposure); } @@ -2219,7 +2219,7 @@ g_free(zexpstr); } } - else if (!strcmp(status_id,"hidden")) { + else if (primitive == GAIM_STATUS_INVISIBLE) { /* XXX handle errors */ if (use_zeph02(zephyr)) { ZSetLocation(EXPOSE_OPSTAFF); @@ -2250,15 +2250,16 @@ Away won't change their exposure but will set an auto away message (for IMs only) */ - type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, "available", _("Available"), FALSE); + type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, NULL, NULL, FALSE); types = g_list_append(types,type); - type = gaim_status_type_new(GAIM_STATUS_HIDDEN, "hidden", _("Hidden"), FALSE); + type = gaim_status_type_new(GAIM_STATUS_INVISIBLE, NULL, NULL, FALSE); types = g_list_append(types,type); type = gaim_status_type_new_with_attrs( - GAIM_STATUS_AWAY, "away", _("Away"), TRUE, TRUE, FALSE, - "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), NULL); + GAIM_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, type); return types;
--- a/src/status.c Wed Dec 21 07:59:45 2005 +0000 +++ b/src/status.c Wed Dec 21 08:24:17 2005 +0000 @@ -126,9 +126,10 @@ -500, /* offline */ 100, /* available */ -75, /* unavailable */ - -50, /* hidden */ + -50, /* invisible */ -100, /* away */ -200, /* extended away */ + -400, /* mobile */ -10, /* idle, special case. */ -5 /* idle time, special case. */ }; @@ -153,9 +154,10 @@ { GAIM_STATUS_OFFLINE, "offline", N_("Offline") }, { GAIM_STATUS_AVAILABLE, "available", N_("Available") }, { GAIM_STATUS_UNAVAILABLE, "unavailable", N_("Unavailable") }, - { GAIM_STATUS_HIDDEN, "hidden", N_("Hidden") }, + { GAIM_STATUS_INVISIBLE, "invisible", N_("Invisible") }, { GAIM_STATUS_AWAY, "away", N_("Away") }, - { GAIM_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended Away") } + { GAIM_STATUS_EXTENDED_AWAY, "extended_away", N_("Extended Away") }, + { GAIM_STATUS_MOBILE, "mobile", N_("Mobile") } }; const char * @@ -179,8 +181,8 @@ for (i = 0; i < GAIM_STATUS_NUM_PRIMITIVES; i++) { - if (type == status_primitive_map[i].type) - return status_primitive_map[i].name; + if (type == status_primitive_map[i].type) + return status_primitive_map[i].name; } return status_primitive_map[0].name; @@ -214,19 +216,25 @@ GaimStatusType *status_type; g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL); - g_return_val_if_fail(id != NULL, NULL); - g_return_val_if_fail(name != NULL, NULL); status_type = g_new0(GaimStatusType, 1); GAIM_DBUS_REGISTER_POINTER(status_type, GaimStatusType); status_type->primitive = primitive; - status_type->id = g_strdup(id); - status_type->name = g_strdup(name); status_type->saveable = saveable; status_type->user_settable = user_settable; status_type->independent = independent; + if (id != NULL) + status_type->id = g_strdup(id); + else + status_type->id = g_strdup(gaim_primitive_get_id_from_type(primitive)); + + if (name != NULL) + status_type->name = g_strdup(name); + else + status_type->name = g_strdup(_(gaim_primitive_get_name_from_type(primitive))); + return status_type; } @@ -235,8 +243,6 @@ const char *name, gboolean user_settable) { g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL); - g_return_val_if_fail(id != NULL, NULL); - g_return_val_if_fail(name != NULL, NULL); return gaim_status_type_new_full(primitive, id, name, FALSE, user_settable, FALSE); @@ -254,8 +260,6 @@ va_list args; g_return_val_if_fail(primitive != GAIM_STATUS_UNSET, NULL); - g_return_val_if_fail(id != NULL, NULL); - g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(attr_id != NULL, NULL); g_return_val_if_fail(attr_name != NULL, NULL); g_return_val_if_fail(attr_value != NULL, NULL); @@ -1696,8 +1700,8 @@ primitive_scores[GAIM_STATUS_OFFLINE]); gaim_prefs_add_int("/core/status/scores/available", primitive_scores[GAIM_STATUS_AVAILABLE]); - gaim_prefs_add_int("/core/status/scores/hidden", - primitive_scores[GAIM_STATUS_HIDDEN]); + gaim_prefs_add_int("/core/status/scores/invisible", + primitive_scores[GAIM_STATUS_INVISIBLE]); gaim_prefs_add_int("/core/status/scores/away", primitive_scores[GAIM_STATUS_AWAY]); gaim_prefs_add_int("/core/status/scores/extended_away", @@ -1711,9 +1715,9 @@ gaim_prefs_connect_callback(handle, "/core/status/scores/available", score_pref_changed_cb, GINT_TO_POINTER(GAIM_STATUS_AVAILABLE)); - gaim_prefs_connect_callback(handle, "/core/status/scores/hidden", + gaim_prefs_connect_callback(handle, "/core/status/scores/invisible", score_pref_changed_cb, - GINT_TO_POINTER(GAIM_STATUS_HIDDEN)); + GINT_TO_POINTER(GAIM_STATUS_INVISIBLE)); gaim_prefs_connect_callback(handle, "/core/status/scores/away", score_pref_changed_cb, GINT_TO_POINTER(GAIM_STATUS_AWAY));
--- a/src/status.h Wed Dec 21 07:59:45 2005 +0000 +++ b/src/status.h Wed Dec 21 08:24:17 2005 +0000 @@ -100,9 +100,10 @@ GAIM_STATUS_OFFLINE, GAIM_STATUS_AVAILABLE, GAIM_STATUS_UNAVAILABLE, - GAIM_STATUS_HIDDEN, + GAIM_STATUS_INVISIBLE, GAIM_STATUS_AWAY, GAIM_STATUS_EXTENDED_AWAY, + GAIM_STATUS_MOBILE, GAIM_STATUS_NUM_PRIMITIVES } GaimStatusPrimitive; @@ -113,7 +114,7 @@ #include "value.h" /**************************************************************************/ -/** @name GaimStatusPrimtive API */ +/** @name GaimStatusPrimitive API */ /**************************************************************************/ /*@{*/ @@ -159,8 +160,10 @@ * Creates a new status type. * * @param primitive The primitive status type. - * @param id The ID of the status type. - * @param name The name presented to the user. + * @param id The ID of the status type, or @c NULL to use the id of + * the primitive status type. + * @param name The name presented to the user, or @c NULL to use the + * name of the primitive status type. * @param saveable TRUE if the information set for this status by the * user can be saved for future sessions. * @param user_settable TRUE if this is a status the user can manually set. @@ -180,8 +183,10 @@ * savable and not independent). * * @param primitive The primitive status type. - * @param id The ID of the status type. - * @param name The name presented to the user. + * @param id The ID of the status type, or @c NULL to use the id of + * the primitive status type. + * @param name The name presented to the user, or @c NULL to use the + * name of the primitive status type. * @param user_settable TRUE if this is a status the user can manually set. * * @return A new status type. @@ -194,8 +199,10 @@ * Creates a new status type with attributes. * * @param primitive The primitive status type. - * @param id The ID of the status type. - * @param name The name presented to the user. + * @param id The ID of the status type, or @c NULL to use the id of + * the primitive status type. + * @param name The name presented to the user, or @c NULL to use the + * name of the primitive status type. * @param saveable TRUE if the information set for this status by the * user can be saved for future sessions. * @param user_settable TRUE if this is a status the user can manually set. @@ -343,7 +350,7 @@ /** * Returns whether or not a status type is available. * - * Available status types are online and possibly hidden, but not away. + * Available status types are online and possibly invisible, but not away. * * @param status_type The status type. * @@ -608,7 +615,7 @@ /** * Returns whether or not a status is available. * - * Available statuses are online and possibly hidden, but not away or idle. + * Available statuses are online and possibly invisible, but not away or idle. * * This is a convenience method for * gaim_status_type_is_available(gaim_status_get_type(status)). @@ -898,7 +905,7 @@ /** * Returns whether or not a presence is available. * - * Available presences are online and possibly hidden, but not away or idle. + * Available presences are online and possibly invisible, but not away or idle. * * @param presence The presence. *