# HG changeset patch # User Mark Doliner # Date 1130084911 0 # Node ID 50496ebef401ac4e798a6f374e0c514be91741af # Parent 55052a685da68b6d7d5a2fa6a614914799b9e509 [gaim-migrate @ 14046] This change allows text input in the gtkstatusbox whenever you select a status that has a "message" attribute on any of your enabled accounts. This allows you to enter available messages from AIM and Bonjour. committer: Tailor Script diff -r 55052a685da6 -r 50496ebef401 src/gtkstatusbox.c --- a/src/gtkstatusbox.c Sun Oct 23 15:29:34 2005 +0000 +++ b/src/gtkstatusbox.c Sun Oct 23 16:28:31 2005 +0000 @@ -208,7 +208,7 @@ pixbuf = status_box->pixbuf; gtk_list_store_set(status_box->store, &(status_box->iter), - TYPE_COLUMN, -1, /* TODO: Should use something real here? */ + TYPE_COLUMN, -1, /* This field is not used in this list store */ ICON_COLUMN, pixbuf, TEXT_COLUMN, text, TITLE_COLUMN, title, @@ -239,8 +239,6 @@ */ g_snprintf(basename2, sizeof(basename2), "%s.png", basename); - - filename = g_build_filename(DATADIR, "pixmaps", "gaim", "icons", basename2, NULL); pixbuf = gdk_pixbuf_new_from_file(filename, NULL); @@ -695,6 +693,7 @@ GtkGaimStatusBoxItemType type; char *text, *sec_text; GdkPixbuf *pixbuf; + GList *accounts, *node; status_box = GTK_GAIM_STATUS_BOX(box); @@ -730,13 +729,26 @@ } /* - * TODO: Should show the message box whenever 'type' allows - * for a message attribute on any protocol that is enabled. + * Show the message box whenever 'type' allows for a + * message attribute on any protocol that is enabled. */ - if (type == GAIM_STATUS_AWAY) - status_box->imhtml_visible = TRUE; - else - status_box->imhtml_visible = FALSE; + accounts = gaim_accounts_get_all_active(); + status_box->imhtml_visible = FALSE; + for (node = accounts; node != NULL; node = node->next) + { + GaimAccount *account; + GaimStatusType *status_type; + + account = node->data; + status_type = gaim_account_get_status_type_with_primitive(account, type); + if ((status_type != NULL) && + (gaim_status_type_get_attr(status_type, "message") != NULL)) + { + status_box->imhtml_visible = TRUE; + break; + } + } + g_list_free(accounts); if (status_box->imhtml_visible) {