Changes in storage_xml.c [d628339:098a75b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
rd628339 r098a75b 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 104 85 static xt_status handle_account(struct xt_node *node, gpointer data) 105 86 { … … 108 89 char *pass_b64 = NULL; 109 90 unsigned char *pass_cr = NULL; 110 int pass_len ;91 int pass_len, local = 0; 111 92 struct prpl *prpl = NULL; 112 93 account_t *acc; … … 123 104 prpl = find_protocol(protocol); 124 105 if (!prpl) { 125 irc_rootmsg(xd->irc, "Warning: Protocol not found: `%s'", protocol); 126 prpl = (struct prpl*) &protocol_missing; 127 } 106 irc_rootmsg(xd->irc, "Error loading user config: Protocol not found: `%s'", protocol); 107 return XT_ABORT; 108 } 109 local = protocol_account_islocal(protocol); 128 110 } 129 111 … … 142 124 set_setstr(&acc->set, "tag", tag); 143 125 } 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; 126 if (local) { 127 acc->flags |= ACC_FLAG_LOCAL; 148 128 } 149 129 } else { … … 156 136 g_free(password); 157 137 158 if (prpl == &protocol_missing) { 159 handle_settings_raw(node, &acc->set); 160 } else { 161 handle_settings(node, &acc->set); 162 } 138 handle_settings(node, &acc->set); 163 139 164 140 for (c = node->children; (c = xt_find_node(c, "buddy")); c = c->next) { … … 336 312 337 313 cur = xt_new_node("account", NULL, NULL); 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 } 314 xt_add_attr(cur, "protocol", acc->prpl->name); 343 315 xt_add_attr(cur, "handle", acc->user); 344 316 xt_add_attr(cur, "password", pass_b64);
Note: See TracChangeset
for help on using the changeset viewer.