# HG changeset patch # User Nathan Walp # Date 1072688627 0 # Node ID 1b8261f374ea6925849e0997a7f44ecc0c8697b7 # Parent 119a22025818a7b73cbbe2bf96597f547bd45dd2 [gaim-migrate @ 8631] This is the death of protocol numbers. There are probably now a few functions that should now go away, but i'll let our crack team of crazy patch writers figure out which ones they are. out-of-tree and unofficial prpl-writers, rejoice! committer: Tailor Script diff -r 119a22025818 -r 1b8261f374ea src/account.c --- a/src/account.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/account.c Mon Dec 29 09:03:47 2003 +0000 @@ -137,10 +137,7 @@ gaim_account_set_username(account, username); - if(protocol_id) - gaim_account_set_protocol_id(account, protocol_id); - else - gaim_account_set_protocol(account, GAIM_PROTO_DEFAULT); + gaim_account_set_protocol_id(account, protocol_id ? protocol_id : GAIM_PROTO_DEFAULT); account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, delete_setting); diff -r 119a22025818 -r 1b8261f374ea src/blist.c --- a/src/blist.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/blist.c Mon Dec 29 09:03:47 2003 +0000 @@ -500,7 +500,7 @@ GaimPluginProtocolInfo *prpl_info; struct proto_chat_entry *pce; - prpl = gaim_find_prpl(gaim_account_get_protocol(chat->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(chat->account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); parts = prpl_info->chat_info(chat->account->gc); @@ -1349,7 +1349,7 @@ chat = (GaimChat*)node; - prpl = gaim_find_prpl(gaim_account_get_protocol(chat->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(chat->account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); parts = prpl_info->chat_info( diff -r 119a22025818 -r 1b8261f374ea src/connection.c --- a/src/connection.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/connection.c Mon Dec 29 09:03:47 2003 +0000 @@ -48,7 +48,7 @@ gc = g_new0(GaimConnection, 1); - gc->prpl = gaim_find_prpl(gaim_account_get_protocol(account)); + gc->prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); gaim_connection_set_account(gc, account); gaim_account_set_connection(account, gc); diff -r 119a22025818 -r 1b8261f374ea src/dialogs.c --- a/src/dialogs.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/dialogs.c Mon Dec 29 09:03:47 2003 +0000 @@ -1339,13 +1339,12 @@ { GaimGtkConversation *gtkconv; char *smiley_text = g_object_get_data(G_OBJECT(widget), "smiley_text"); - GaimProtocol protocol = gaim_account_get_protocol(gaim_conversation_get_account(c)); - GaimPlugin *proto = gaim_find_prpl(protocol); - + GaimPlugin *proto = gaim_find_prpl(gaim_account_get_protocol_id(gaim_conversation_get_account(c))); + gtkconv = GAIM_GTK_CONVERSATION(c); - + gtk_imhtml_insert_smiley(GTK_IMHTML(gtkconv->entry), proto->info->name, smiley_text); - + close_smiley_dialog(NULL, c); } @@ -1397,7 +1396,7 @@ if(c->account) smileys = get_proto_smileys( - gaim_account_get_protocol(gaim_conversation_get_account(c))); + gaim_account_get_protocol_id(gaim_conversation_get_account(c))); else smileys = get_proto_smileys(GAIM_PROTO_DEFAULT); diff -r 119a22025818 -r 1b8261f374ea src/gtkaccount.c --- a/src/gtkaccount.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/gtkaccount.c Mon Dec 29 09:03:47 2003 +0000 @@ -81,7 +81,6 @@ GaimGtkAccountDialogType type; GaimAccount *account; - GaimProtocol protocol; char *protocol_id; GaimPlugin *plugin; GaimPluginProtocolInfo *prpl_info; @@ -152,9 +151,9 @@ GaimAccount *account); static char * -proto_name(int proto) +proto_name(const char *id) { - GaimPlugin *p = gaim_find_prpl(proto); + GaimPlugin *p = gaim_find_prpl(id); return ((p && p->info->name) ? _(p->info->name) : _("Unknown")); } @@ -192,12 +191,11 @@ } static void -set_account_protocol_cb(GtkWidget *item, GaimProtocol protocol, +set_account_protocol_cb(GtkWidget *item, const char *id, AccountPrefsDialog *dialog) { - if ((dialog->plugin = gaim_find_prpl(protocol)) != NULL) { + if ((dialog->plugin = gaim_find_prpl(id)) != NULL) { dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); - dialog->protocol = dialog->prpl_info->protocol; if (dialog->protocol_id != NULL) g_free(dialog->protocol_id); @@ -381,7 +379,7 @@ /* Protocol */ dialog->protocol_menu = gaim_gtk_protocol_option_menu_new( - dialog->protocol, G_CALLBACK(set_account_protocol_cb), dialog); + dialog->protocol_id, G_CALLBACK(set_account_protocol_cb), dialog); add_pref_box(dialog, vbox, _("Protocol:"), dialog->protocol_menu); @@ -647,15 +645,13 @@ switch (gaim_account_option_get_type(option)) { case GAIM_PREF_BOOLEAN: - if (account == NULL || - gaim_account_get_protocol(account) != dialog->protocol) { - + if (account == NULL || !strcmp(gaim_account_get_protocol_id(account), dialog->protocol_id)) { bool_value = gaim_account_option_get_default_bool(option); - } - else + } else { bool_value = gaim_account_get_bool(account, gaim_account_option_get_setting(option), gaim_account_option_get_default_bool(option)); + } check = gtk_check_button_new_with_label( gaim_account_option_get_text(option)); @@ -672,15 +668,13 @@ break; case GAIM_PREF_INT: - if (account == NULL || - gaim_account_get_protocol(account) != dialog->protocol) { - + if (account == NULL || !strcmp(gaim_account_get_protocol_id(account), dialog->protocol_id)) { int_value = gaim_account_option_get_default_int(option); - } - else + } else { int_value = gaim_account_get_int(account, gaim_account_option_get_setting(option), gaim_account_option_get_default_int(option)); + } g_snprintf(buf, sizeof(buf), "%d", int_value); @@ -700,15 +694,13 @@ break; case GAIM_PREF_STRING: - if (account == NULL || - gaim_account_get_protocol(account) != dialog->protocol) { - + if (account == NULL || !strcmp(gaim_account_get_protocol_id(account), dialog->protocol_id)) { str_value = gaim_account_option_get_default_string(option); - } - else + } else { str_value = gaim_account_get_string(account, gaim_account_option_get_setting(option), gaim_account_option_get_default_string(option)); + } entry = gtk_entry_new(); @@ -1198,16 +1190,14 @@ dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); if (dialog->account == NULL) { - dialog->protocol_id = g_strdup("prpl-oscar"); - dialog->protocol = GAIM_PROTO_OSCAR; + dialog->protocol_id = g_strdup(GAIM_PROTO_DEFAULT); } else { dialog->protocol_id = g_strdup(gaim_account_get_protocol_id(dialog->account)); - dialog->protocol = gaim_account_get_protocol(dialog->account); } - if ((dialog->plugin = gaim_find_prpl(dialog->protocol)) != NULL) + if ((dialog->plugin = gaim_find_prpl(dialog->protocol_id)) != NULL) dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); @@ -1805,7 +1795,7 @@ COLUMN_SCREENNAME, gaim_account_get_username(account), COLUMN_ONLINE, gaim_account_is_connected(account), COLUMN_AUTOLOGIN, gaim_account_get_auto_login(account, GAIM_GTK_UI), - COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol(account)), + COLUMN_PROTOCOL, proto_name(gaim_account_get_protocol_id(account)), COLUMN_DATA, account, -1); diff -r 119a22025818 -r 1b8261f374ea src/gtkblist.c --- a/src/gtkblist.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/gtkblist.c Mon Dec 29 09:03:47 2003 +0000 @@ -964,7 +964,7 @@ b = (GaimBuddy *)node; /* Protocol specific options */ - prpl = gaim_find_prpl(gaim_account_get_protocol(b->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(b->account)); if (prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); @@ -1022,7 +1022,7 @@ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu); gtk_widget_show(submenu); - prpl = gaim_find_prpl(gaim_account_get_protocol(buddy->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(buddy->account)); prpl_info = prpl ? GAIM_PLUGIN_PROTOCOL_INFO(prpl) : NULL; make_buddy_menu(submenu, prpl_info, buddy); @@ -1744,7 +1744,7 @@ GaimPlugin *prpl; GaimPluginProtocolInfo *prpl_info = NULL; char *text = NULL; - + if(GAIM_BLIST_NODE_IS_CHAT(node)) { GaimChat *chat = (GaimChat *)node; char *name = NULL; @@ -1752,7 +1752,7 @@ GList *parts, *tmp; GString *parts_text = g_string_new(""); - prpl = gaim_find_prpl(gaim_account_get_protocol(chat->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(chat->account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); parts = prpl_info->chat_info(chat->account->gc); @@ -1809,7 +1809,7 @@ b = (GaimBuddy *)node; } - prpl = gaim_find_prpl(gaim_account_get_protocol(b->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(b->account)); prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); if (prpl_info && prpl_info->tooltip_text) { @@ -1927,7 +1927,7 @@ else account = chat->account; - prpl = gaim_find_prpl(gaim_account_get_protocol(account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); if(!prpl) return NULL; @@ -2065,7 +2065,7 @@ name = gaim_get_buddy_alias(b); esc = g_markup_escape_text(name, strlen(name)); - prpl = gaim_find_prpl(gaim_account_get_protocol(b->account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(b->account)); if (prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); @@ -3849,7 +3849,7 @@ const char *protoname = NULL; char buf[256]; - prpl = gaim_find_prpl(gaim_account_get_protocol(account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); if (prpl != NULL) { prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); diff -r 119a22025818 -r 1b8261f374ea src/gtkconv.c --- a/src/gtkconv.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/gtkconv.c Mon Dec 29 09:03:47 2003 +0000 @@ -4544,7 +4544,8 @@ if (gaim_prefs_get_bool("/gaim/gtk/conversations/ignore_font_sizes")) gtk_font_options ^= GTK_IMHTML_NO_SIZES; - if (GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol(conv->account)))->options & + /* this is gonna crash one day, I can feel it. */ + if (GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(conv->account)))->options & OPT_PROTO_USE_POINTSIZE) { gtk_font_options ^= GTK_IMHTML_USE_POINTSIZE; } diff -r 119a22025818 -r 1b8261f374ea src/gtkutils.c --- a/src/gtkutils.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/gtkutils.c Mon Dec 29 09:03:47 2003 +0000 @@ -619,22 +619,22 @@ { GtkWidget *menu; GtkWidget *item; - GaimProtocol protocol; + const char *protocol; gpointer user_data; menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optmenu)); item = gtk_menu_get_active(GTK_MENU(menu)); - protocol = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "protocol")); + protocol = g_object_get_data(G_OBJECT(item), "protocol"); user_data = (g_object_get_data(G_OBJECT(optmenu), "user_data")); if (cb != NULL) - ((void (*)(GtkWidget *, GaimProtocol, gpointer))cb)(item, protocol, + ((void (*)(GtkWidget *, const char *, gpointer))cb)(item, protocol, user_data); } GtkWidget * -gaim_gtk_protocol_option_menu_new(GaimProtocol protocol, GCallback cb, +gaim_gtk_protocol_option_menu_new(const char *id, GCallback cb, gpointer user_data) { GaimPluginProtocolInfo *prpl_info; @@ -712,13 +712,12 @@ gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); gtk_widget_show(label); - g_object_set_data(G_OBJECT(item), "protocol", - GINT_TO_POINTER(prpl_info->protocol)); + g_object_set_data(G_OBJECT(item), "protocol", plugin->info->id); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); gtk_widget_show(item); - if (prpl_info->protocol == protocol) + if (!strcmp(plugin->info->id, id)) selected_index = i; } @@ -799,7 +798,7 @@ if (check_account_func && !check_account_func(account)) continue; - plugin = gaim_find_prpl(gaim_account_get_protocol(account)); + plugin = gaim_find_prpl(gaim_account_get_protocol_id(account)); if (plugin != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin); diff -r 119a22025818 -r 1b8261f374ea src/gtkutils.h --- a/src/gtkutils.h Mon Dec 29 08:59:22 2003 +0000 +++ b/src/gtkutils.h Mon Dec 29 09:03:47 2003 +0000 @@ -231,13 +231,13 @@ /** * Creates a drop-down option menu filled with protocols. * - * @param protocol The protocol to select by default. + * @param id The protocol to select by default. * @param cb The callback to call when a protocol is selected. * @param user_data Data to pass to the callback function. * * @return The drop-down option menu. */ -GtkWidget *gaim_gtk_protocol_option_menu_new(GaimProtocol protocol, +GtkWidget *gaim_gtk_protocol_option_menu_new(const char *id, GCallback cb, gpointer user_data); diff -r 119a22025818 -r 1b8261f374ea src/log.c --- a/src/log.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/log.c Mon Dec 29 09:03:47 2003 +0000 @@ -249,8 +249,9 @@ const char *filename; char *me = g_strdup(gaim_normalize(account, gaim_account_get_username(account))); + /* does this seem like a bad way to get this component of the path to anyone else? --Nathan */ const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO - (gaim_find_prpl(gaim_account_get_protocol(account)))->list_icon(account, NULL); + (gaim_find_prpl(gaim_account_get_protocol_id(account)))->list_icon(account, NULL); char *path = g_build_filename(gaim_user_dir(), "logs", prpl, me, gaim_normalize(account, screenname), NULL); g_free(me); @@ -430,7 +431,7 @@ char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); char *chat; const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO - (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); + (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL); char *dir; char *filename; @@ -577,7 +578,7 @@ char *guy = g_strdup(gaim_normalize(log->account, gaim_account_get_username(log->account))); char *chat; const char *prpl = GAIM_PLUGIN_PROTOCOL_INFO - (gaim_find_prpl(gaim_account_get_protocol(log->account)))->list_icon(log->account, NULL); + (gaim_find_prpl(gaim_account_get_protocol_id(log->account)))->list_icon(log->account, NULL); char *dir; if (log->type == GAIM_LOG_CHAT) { diff -r 119a22025818 -r 1b8261f374ea src/main.c --- a/src/main.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/main.c Mon Dec 29 09:03:47 2003 +0000 @@ -155,7 +155,7 @@ account = gaim_accounts_find(username, NULL); if (!account) { - account = gaim_account_new(username, "prpl-oscar"); + account = gaim_account_new(username, GAIM_PROTO_DEFAULT); gaim_account_set_remember_password(account, FALSE); gaim_accounts_add(account); } @@ -470,7 +470,7 @@ account = gaim_accounts_find(name, NULL); if (account == NULL) { /* new user */ - account = gaim_account_new(name, "prpl-oscar"); + account = gaim_account_new(name, GAIM_PROTO_DEFAULT); gaim_accounts_add(account); } diff -r 119a22025818 -r 1b8261f374ea src/plugin.c --- a/src/plugin.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/plugin.c Mon Dec 29 09:03:47 2003 +0000 @@ -133,10 +133,17 @@ compare_prpl(GaimPlugin *a, GaimPlugin *b) { /* neg if a before b, 0 if equal, pos if a after b */ - return ((GAIM_IS_PROTOCOL_PLUGIN(a) - ? GAIM_PLUGIN_PROTOCOL_INFO(a)->protocol : -1) - - ((GAIM_IS_PROTOCOL_PLUGIN(b) - ? GAIM_PLUGIN_PROTOCOL_INFO(b)->protocol : -1))); + if(GAIM_IS_PROTOCOL_PLUGIN(a)) { + if(GAIM_IS_PROTOCOL_PLUGIN(b)) + return strcmp(a->info->name, b->info->name); + else + return -1; + } else { + if(GAIM_IS_PROTOCOL_PLUGIN(b)) + return 1; + else + return 0; + } } GaimPlugin * @@ -870,8 +877,7 @@ continue; } - if (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->protocol == GAIM_PROTO_ICQ || - gaim_find_prpl(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->protocol)) + if (gaim_find_prpl(plugin->info->id)) { /* Nothing to see here--move along, move along */ gaim_plugin_destroy(plugin); diff -r 119a22025818 -r 1b8261f374ea src/protocols/gg/gg.c --- a/src/protocols/gg/gg.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/gg/gg.c Mon Dec 29 09:03:47 2003 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 8255 2003-11-25 07:16:11Z faceprint $ + * $Id: gg.c 8631 2003-12-29 09:03:47Z faceprint $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz * @@ -1302,7 +1302,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_GADUGADU, 0, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/irc/irc.c Mon Dec 29 09:03:47 2003 +0000 @@ -467,7 +467,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_IRC, OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/jabber/jabber.c Mon Dec 29 09:03:47 2003 +0000 @@ -1083,7 +1083,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_JABBER, OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/msn/msn.c Mon Dec 29 09:03:47 2003 +0000 @@ -1568,7 +1568,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_MSN, OPT_PROTO_MAIL_CHECK | OPT_PROTO_BUDDY_ICON, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/napster/napster.c --- a/src/protocols/napster/napster.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/napster/napster.c Mon Dec 29 09:03:47 2003 +0000 @@ -551,7 +551,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_NAPSTER, OPT_PROTO_CHAT_TOPIC, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Dec 29 09:03:47 2003 +0000 @@ -6624,7 +6624,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_OSCAR, OPT_PROTO_MAIL_CHECK | OPT_PROTO_BUDDY_ICON | OPT_PROTO_IM_IMAGE, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/toc/toc.c --- a/src/protocols/toc/toc.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/toc/toc.c Mon Dec 29 09:03:47 2003 +0000 @@ -2091,7 +2091,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_TOC, OPT_PROTO_CORRECT_TIME, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/trepia/trepia.c --- a/src/protocols/trepia/trepia.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/trepia/trepia.c Mon Dec 29 09:03:47 2003 +0000 @@ -1252,7 +1252,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_TREPIA, OPT_PROTO_BUDDY_ICON, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/yahoo/yahoo.c Mon Dec 29 09:03:47 2003 +0000 @@ -3099,7 +3099,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_YAHOO, OPT_PROTO_MAIL_CHECK | OPT_PROTO_CHAT_TOPIC, NULL, /* user_splits */ NULL, /* protocol_options */ diff -r 119a22025818 -r 1b8261f374ea src/protocols/zephyr/zephyr.c --- a/src/protocols/zephyr/zephyr.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/protocols/zephyr/zephyr.c Mon Dec 29 09:03:47 2003 +0000 @@ -982,7 +982,6 @@ static GaimPluginProtocolInfo prpl_info = { - GAIM_PROTO_ZEPHYR, OPT_PROTO_NO_PASSWORD, NULL, NULL, diff -r 119a22025818 -r 1b8261f374ea src/prpl.c --- a/src/prpl.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/prpl.c Mon Dec 29 09:03:47 2003 +0000 @@ -78,7 +78,7 @@ } GaimPlugin * -gaim_find_prpl(GaimProtocol type) +gaim_find_prpl(const char *id) { GList *l; GaimPlugin *plugin; @@ -89,7 +89,7 @@ /* Just In Case (TM) */ if (GAIM_IS_PROTOCOL_PLUGIN(plugin)) { - if (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->protocol == type) + if (!strcmp(plugin->info->id, id)) return plugin; } } diff -r 119a22025818 -r 1b8261f374ea src/prpl.h --- a/src/prpl.h Mon Dec 29 08:59:22 2003 +0000 +++ b/src/prpl.h Mon Dec 29 09:03:47 2003 +0000 @@ -83,7 +83,7 @@ "in the \"Tools\" menu in the buddy list window." /** Default protocol */ -#define GAIM_PROTO_DEFAULT GAIM_PROTO_OSCAR +#define GAIM_PROTO_DEFAULT "prpl-oscar" /*@}*/ @@ -194,7 +194,6 @@ */ struct _GaimPluginProtocolInfo { - GaimProtocol protocol; /**< The protocol type. */ GaimProtocolOptions options; /**< Protocol options. */ GList *user_splits; /* A GList of GaimAccountUserSplit */ @@ -349,7 +348,7 @@ * * @param type The protocol plugin; */ -GaimPlugin *gaim_find_prpl(GaimProtocol type); +GaimPlugin *gaim_find_prpl(const char *id); #ifdef __cplusplus } diff -r 119a22025818 -r 1b8261f374ea src/server.c --- a/src/server.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/server.c Mon Dec 29 09:03:47 2003 +0000 @@ -40,7 +40,7 @@ void serv_login(GaimAccount *account) { - GaimPlugin *p = gaim_find_prpl(gaim_account_get_protocol(account)); + GaimPlugin *p = gaim_find_prpl(gaim_account_get_protocol_id(account)); GaimPluginProtocolInfo *prpl_info = NULL; if (account->gc == NULL || p == NULL) diff -r 119a22025818 -r 1b8261f374ea src/themes.c --- a/src/themes.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/themes.c Mon Dec 29 09:03:47 2003 +0000 @@ -236,8 +236,8 @@ } } -GSList *get_proto_smileys(int protocol) { - GaimPlugin *proto = gaim_find_prpl(protocol); +GSList *get_proto_smileys(const char *id) { + GaimPlugin *proto = gaim_find_prpl(id); struct smiley_list *list, *def; if(!current_smiley_theme) diff -r 119a22025818 -r 1b8261f374ea src/ui.h --- a/src/ui.h Mon Dec 29 08:59:22 2003 +0000 +++ b/src/ui.h Mon Dec 29 09:03:47 2003 +0000 @@ -157,6 +157,6 @@ extern void smiley_themeize(GtkWidget *); extern void smiley_theme_probe(); extern void load_smiley_theme(const char *file, gboolean load); -extern GSList *get_proto_smileys(int protocol); +extern GSList *get_proto_smileys(const char *id); #endif /* _UI_H_ */ diff -r 119a22025818 -r 1b8261f374ea src/util.c --- a/src/util.c Mon Dec 29 08:59:22 2003 +0000 +++ b/src/util.c Mon Dec 29 09:03:47 2003 +0000 @@ -1586,7 +1586,7 @@ const char *ret = NULL; if(account) - prpl = gaim_find_prpl(gaim_account_get_protocol(account)); + prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); if(prpl) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);