comparison pidgin/gtkdisco.c @ 26342:d6b2944f04b3

s/category/type/ and s/muc/chat/ in the core and gateway type is a string. 'type' seems a more reasonable name (category and type are fairly specific XMPP-isms even though this is basically only ever going to be useful for XMPP). Changing the gateway type (i.e. prpl identifier) to a string means adding them doesn't require minor bumps (and sane fallback methods should be implementable).
author Paul Aurich <paul@darkrain42.org>
date Wed, 01 Apr 2009 05:26:25 +0000
parents c619bef09bec
children 1009214ba476
comparison
equal deleted inserted replaced
26341:9d0bad6f4b0d 26342:d6b2944f04b3
128 g_return_if_fail(info != NULL); 128 g_return_if_fail(info != NULL);
129 129
130 account = purple_disco_list_get_account(info->list); 130 account = purple_disco_list_get_account(info->list);
131 name = purple_disco_service_get_name(info->service); 131 name = purple_disco_service_get_name(info->service);
132 132
133 if (purple_disco_service_get_category(info->service) == PURPLE_DISCO_SERVICE_CAT_MUC) 133 if (purple_disco_service_get_type(info->service) == PURPLE_DISCO_SERVICE_TYPE_CHAT)
134 purple_blist_request_add_chat(account, NULL, NULL, name); 134 purple_blist_request_add_chat(account, NULL, NULL, name);
135 else 135 else
136 purple_blist_request_add_buddy(account, name, NULL, NULL); 136 purple_blist_request_add_buddy(account, name, NULL, NULL);
137 } 137 }
138 138
457 457
458 static void pidgin_disco_add_service(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent) 458 static void pidgin_disco_add_service(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent)
459 { 459 {
460 PidginDiscoList *pdl; 460 PidginDiscoList *pdl;
461 PidginDiscoDialog *dialog; 461 PidginDiscoDialog *dialog;
462 PurpleDiscoServiceCategory category;
463 PurpleDiscoServiceType type; 462 PurpleDiscoServiceType type;
463 const char *gateway_type;
464 GtkTreeIter iter, parent_iter; 464 GtkTreeIter iter, parent_iter;
465 GtkTreeRowReference *rr; 465 GtkTreeRowReference *rr;
466 GtkTreePath *path; 466 GtkTreePath *path;
467 char *filename = NULL; 467 char *filename = NULL;
468 GdkPixbuf *pixbuf = NULL; 468 GdkPixbuf *pixbuf = NULL;
483 } 483 }
484 } 484 }
485 485
486 gtk_tree_store_append(pdl->model, &iter, (parent ? &parent_iter : NULL)); 486 gtk_tree_store_append(pdl->model, &iter, (parent ? &parent_iter : NULL));
487 487
488 category = purple_disco_service_get_category(service);
489 type = purple_disco_service_get_type(service); 488 type = purple_disco_service_get_type(service);
490 489 gateway_type = purple_disco_service_get_gateway_type(service);
491 if (type == PURPLE_DISCO_SERVICE_TYPE_XMPP) 490
492 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "jabber.png", NULL); 491 if (type == PURPLE_DISCO_SERVICE_TYPE_GATEWAY && gateway_type) {
493 else if (type == PURPLE_DISCO_SERVICE_TYPE_ICQ) 492 char *tmp = g_strconcat(gateway_type, ".png", NULL);
494 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "icq.png", NULL); 493 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", tmp, NULL);
495 else if (type == PURPLE_DISCO_SERVICE_TYPE_YAHOO) 494 g_free(tmp);
496 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "yahoo.png", NULL); 495 #if 0
497 else if (type == PURPLE_DISCO_SERVICE_TYPE_GTALK) 496 } else if (type == PURPLE_DISCO_SERVICE_TYPE_USER) {
498 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "google-talk.png", NULL);
499 else if (type == PURPLE_DISCO_SERVICE_TYPE_IRC)
500 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "irc.png", NULL);
501 else if (type == PURPLE_DISCO_SERVICE_TYPE_GG)
502 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "gadu-gadu.png", NULL);
503 else if (type == PURPLE_DISCO_SERVICE_TYPE_AIM)
504 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "aim.png", NULL);
505 else if (type == PURPLE_DISCO_SERVICE_TYPE_QQ)
506 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "qq.png", NULL);
507 else if (type == PURPLE_DISCO_SERVICE_TYPE_MSN)
508 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", "22", "msn.png", NULL);
509 else if (type == PURPLE_DISCO_SERVICE_TYPE_USER)
510 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", "22", "person.png", NULL); 497 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", "22", "person.png", NULL);
511 else if (category == PURPLE_DISCO_SERVICE_CAT_MUC) 498 #endif
499 } else if (type == PURPLE_DISCO_SERVICE_TYPE_CHAT)
512 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", "22", "chat.png", NULL); 500 filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", "22", "chat.png", NULL);
513 501
514 if (filename) { 502 if (filename) {
515 pixbuf = gdk_pixbuf_new_from_file(filename, NULL); 503 pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
516 g_free(filename); 504 g_free(filename);