Changes in protocols/nogaim.c [eb73d05:5a8afc3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/nogaim.c
reb73d05 r5a8afc3 50 50 } 51 51 52 /* semi-private */ 53 gboolean plugin_info_validate(struct plugin_info *info, const char *path) 52 gboolean load_plugin(char *path) 54 53 { 55 54 GList *l; 56 gboolean loaded = FALSE; 57 58 if (!path) { 59 path = "(null)"; 60 } 61 62 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 63 log_message(LOGLVL_ERROR, 64 "`%s' uses ABI %u but %u is required\n", 65 path, info->abiver, 66 BITLBEE_ABI_VERSION_CODE); 67 return FALSE; 68 } 69 70 if (!info->name || !info->version) { 71 log_message(LOGLVL_ERROR, 72 "Name or version missing from the " 73 "plugin info in `%s'\n", path); 74 return FALSE; 75 } 76 77 for (l = plugins; l; l = l->next) { 78 struct plugin_info *i = l->data; 79 80 if (g_strcasecmp(i->name, info->name) == 0) { 81 loaded = TRUE; 82 break; 83 } 84 } 85 86 if (loaded) { 87 log_message(LOGLVL_WARNING, 88 "%s plugin already loaded\n", 89 info->name); 90 return FALSE; 91 } 92 93 return TRUE; 94 } 95 96 /* semi-private */ 97 gboolean plugin_info_add(struct plugin_info *info) 98 { 99 plugins = g_list_insert_sorted_with_data(plugins, info, pluginscmp, NULL); 100 return TRUE; 101 } 102 103 gboolean load_plugin(char *path) 104 { 105 struct plugin_info *info = NULL; 55 struct plugin_info *i; 56 struct plugin_info *info; 106 57 struct plugin_info * (*info_function) (void) = NULL; 107 58 void (*init_function) (void); 108 59 109 60 GModule *mod = g_module_open(path, G_MODULE_BIND_LAZY); 61 gboolean loaded = FALSE; 110 62 111 63 if (!mod) { … … 117 69 info = info_function(); 118 70 119 if (!plugin_info_validate(info, path)) { 71 if (info->abiver != BITLBEE_ABI_VERSION_CODE) { 72 log_message(LOGLVL_ERROR, 73 "`%s' uses ABI %u but %u is required\n", 74 path, info->abiver, 75 BITLBEE_ABI_VERSION_CODE); 76 g_module_close(mod); 77 return FALSE; 78 } 79 80 if (!info->name || !info->version) { 81 log_message(LOGLVL_ERROR, 82 "Name or version missing from the " 83 "plugin info in `%s'\n", path); 84 g_module_close(mod); 85 return FALSE; 86 } 87 88 for (l = plugins; l; l = l->next) { 89 i = l->data; 90 91 if (g_strcasecmp(i->name, info->name) == 0) { 92 loaded = TRUE; 93 break; 94 } 95 } 96 97 if (loaded) { 98 log_message(LOGLVL_WARNING, 99 "%s plugin already loaded\n", 100 info->name); 120 101 g_module_close(mod); 121 102 return FALSE; … … 132 113 133 114 if (info_function) { 134 plugin_info_add(info); 115 plugins = g_list_insert_sorted_with_data(plugins, info, 116 pluginscmp, NULL); 135 117 } 136 118 … … 768 750 msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL; 769 751 away = imc_away_state_find(m, away, &msg) ? : 770 (imc_away_state_find(m, "away", NULL) ? : m->data);752 (imc_away_state_find(m, "away", &msg) ? : m->data); 771 753 } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) { 772 754 away = NULL; … … 802 784 contains no data unless it adds something to what 803 785 we have in state already. */ 804 if ( message &&strlen(m->data) == strlen(away)) {786 if (strlen(m->data) == strlen(away)) { 805 787 *message = NULL; 806 788 } … … 828 810 for (m = gcm; m; m = m->next) { 829 811 if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) { 830 if (!keep_message && message) {812 if (!keep_message) { 831 813 *message = NULL; 832 814 }
Note: See TracChangeset
for help on using the changeset viewer.