Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    rd628339 r098a75b  
    8383}
    8484
    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 
    10485static xt_status handle_account(struct xt_node *node, gpointer data)
    10586{
     
    10889        char *pass_b64 = NULL;
    10990        unsigned char *pass_cr = NULL;
    110         int pass_len;
     91        int pass_len, local = 0;
    11192        struct prpl *prpl = NULL;
    11293        account_t *acc;
     
    123104                prpl = find_protocol(protocol);
    124105                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);
    128110        }
    129111
     
    142124                        set_setstr(&acc->set, "tag", tag);
    143125                }
    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;
    148128                }
    149129        } else {
     
    156136        g_free(password);
    157137
    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);
    163139
    164140        for (c = node->children; (c = xt_find_node(c, "buddy")); c = c->next) {
     
    336312
    337313                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);
    343315                xt_add_attr(cur, "handle", acc->user);
    344316                xt_add_attr(cur, "password", pass_b64);
Note: See TracChangeset for help on using the changeset viewer.