comparison src/plugin.c @ 7956:1b8261f374ea

[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 <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 29 Dec 2003 09:03:47 +0000
parents 0d24c94e4fbc
children fa6395637e2c
comparison
equal deleted inserted replaced
7955:119a22025818 7956:1b8261f374ea
131 131
132 static gint 132 static gint
133 compare_prpl(GaimPlugin *a, GaimPlugin *b) 133 compare_prpl(GaimPlugin *a, GaimPlugin *b)
134 { 134 {
135 /* neg if a before b, 0 if equal, pos if a after b */ 135 /* neg if a before b, 0 if equal, pos if a after b */
136 return ((GAIM_IS_PROTOCOL_PLUGIN(a) 136 if(GAIM_IS_PROTOCOL_PLUGIN(a)) {
137 ? GAIM_PLUGIN_PROTOCOL_INFO(a)->protocol : -1) - 137 if(GAIM_IS_PROTOCOL_PLUGIN(b))
138 ((GAIM_IS_PROTOCOL_PLUGIN(b) 138 return strcmp(a->info->name, b->info->name);
139 ? GAIM_PLUGIN_PROTOCOL_INFO(b)->protocol : -1))); 139 else
140 return -1;
141 } else {
142 if(GAIM_IS_PROTOCOL_PLUGIN(b))
143 return 1;
144 else
145 return 0;
146 }
140 } 147 }
141 148
142 GaimPlugin * 149 GaimPlugin *
143 gaim_plugin_new(gboolean native, const char *path) 150 gaim_plugin_new(gboolean native, const char *path)
144 { 151 {
868 gaim_plugin_destroy(plugin); 875 gaim_plugin_destroy(plugin);
869 876
870 continue; 877 continue;
871 } 878 }
872 879
873 if (GAIM_PLUGIN_PROTOCOL_INFO(plugin)->protocol == GAIM_PROTO_ICQ || 880 if (gaim_find_prpl(plugin->info->id))
874 gaim_find_prpl(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->protocol))
875 { 881 {
876 /* Nothing to see here--move along, move along */ 882 /* Nothing to see here--move along, move along */
877 gaim_plugin_destroy(plugin); 883 gaim_plugin_destroy(plugin);
878 884
879 continue; 885 continue;