Changeset d628339
- Timestamp:
- 2015-06-08T01:13:47Z (10 years ago)
- Children:
- c82a88d
- Parents:
- dcfa886
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
rdcfa886 rd628339 460 460 461 461 for (a = irc->b->accounts; a; a = a->next) { 462 char *con ;462 char *con = NULL, *protocol = NULL; 463 463 464 464 if (a->ic && (a->ic->flags & OPT_LOGGED_IN)) { … … 471 471 con = ""; 472 472 } 473 474 irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, a->prpl->name, a->user, con); 473 if (a->prpl == &protocol_missing) { 474 protocol = g_strdup_printf("%s (missing!)", set_getstr(&a->set, "_protocol_name")); 475 } else { 476 protocol = g_strdup(a->prpl->name); 477 } 478 479 irc_rootmsg(irc, "%2d (%s): %s, %s%s", i, a->tag, protocol, a->user, con); 480 g_free(protocol); 475 481 476 482 i++; … … 486 492 487 493 for (a = irc->b->accounts; a; a = a->next) { 488 if (!a->ic && a->auto_connect ) {494 if (!a->ic && a->auto_connect && a->prpl != &protocol_missing) { 489 495 if (strcmp(a->pass, PASSWORD_PENDING) == 0) { 490 496 irc_rootmsg(irc, "Enter password for account %s " … … 543 549 irc_rootmsg(irc, "Enter password for account %s " 544 550 "first (use /OPER)", a->tag); 551 } else if (a->prpl == &protocol_missing) { 552 irc_rootmsg(irc, "Protocol `%s' not recognised (plugin may be missing or not running?)", 553 set_getstr(&a->set, "_protocol_name")); 545 554 } else { 546 555 account_on(irc->b, a); -
storage.c
rdcfa886 rd628339 33 33 34 34 static GList *storage_backends = NULL; 35 36 const struct prpl protocol_missing = { 37 .name = "_unknown", 38 }; 35 39 36 40 void register_storage_backend(storage_t *backend) -
storage.h
rdcfa886 rd628339 62 62 G_GNUC_MALLOC GList *storage_init(const char *primary, char **migrate); 63 63 64 extern const struct prpl protocol_missing; 65 64 66 #endif /* __STORAGE_H__ */ -
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.