Changeset d628339 for storage_xml.c
- Timestamp:
- 2015-06-08T01:13:47Z (9 years ago)
- Children:
- c82a88d
- Parents:
- dcfa886
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
rdcfa886 rd628339 83 83 } 84 84 85 /* Use for unsupported/not-found protocols. Save settings as-is but don't allow changes. */ 86 static void handle_settings_raw(struct xt_node *node, set_t **head) 87 { 88 struct xt_node *c; 89 90 for (c = node->children; (c = xt_find_node(c, "setting")); c = c->next) { 91 char *name = xt_find_attr(c, "name"); 92 93 if (!name) { 94 continue; 95 } 96 97 set_t *s = set_add(head, name, NULL, NULL, NULL); 98 set_setstr(head, name, c->text); 99 s->flags |= SET_HIDDEN | 100 ACC_SET_OFFLINE_ONLY | ACC_SET_ONLINE_ONLY; 101 } 102 } 103 85 104 static xt_status handle_account(struct xt_node *node, gpointer data) 86 105 { … … 104 123 prpl = find_protocol(protocol); 105 124 if (!prpl) { 106 irc_rootmsg(xd->irc, " Error loading user config: Protocol not found: `%s'", protocol);107 return XT_ABORT;125 irc_rootmsg(xd->irc, "Warning: Protocol not found: `%s'", protocol); 126 prpl = (struct prpl*) &protocol_missing; 108 127 } 109 128 } … … 123 142 set_setstr(&acc->set, "tag", tag); 124 143 } 144 if (prpl == &protocol_missing) { 145 set_t *s = set_add(&acc->set, "_protocol_name", protocol, NULL, NULL); 146 s->flags |= SET_HIDDEN | SET_NOSAVE | 147 ACC_SET_OFFLINE_ONLY | ACC_SET_ONLINE_ONLY; 148 } 125 149 } else { 126 150 g_free(pass_cr); … … 132 156 g_free(password); 133 157 134 handle_settings(node, &acc->set); 158 if (prpl == &protocol_missing) { 159 handle_settings_raw(node, &acc->set); 160 } else { 161 handle_settings(node, &acc->set); 162 } 135 163 136 164 for (c = node->children; (c = xt_find_node(c, "buddy")); c = c->next) { … … 308 336 309 337 cur = xt_new_node("account", NULL, NULL); 310 xt_add_attr(cur, "protocol", acc->prpl->name); 338 if (acc->prpl == &protocol_missing) { 339 xt_add_attr(cur, "protocol", set_getstr(&acc->set, "_protocol_name")); 340 } else { 341 xt_add_attr(cur, "protocol", acc->prpl->name); 342 } 311 343 xt_add_attr(cur, "handle", acc->user); 312 344 xt_add_attr(cur, "password", pass_b64);
Note: See TracChangeset
for help on using the changeset viewer.