Mercurial > pidgin.yaz
diff src/blist.c @ 5943:a4f2aba0848d
[gaim-migrate @ 6384]
This should fix corruption in the blist, accounts, and pounces when some
protocol plugins cannot load. Some parts of gaim now use the new unique
Plugin or Protocol Plugin IDs, while some still use the old protocol
numbers. Accounts kind of used both, and when prpls were missing, it had
trouble finding accounts. It would find the names, even without mapping the
protocol numbers to IDs, and any duplicate accounts would get nuked. That
would then affect pounce saving. Anyhow, long story short (well, it's
already long, too late for that), this should fix all that mess. And
introduce new mess, but hopefully temporary mess.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 23 Jun 2003 02:00:15 +0000 |
parents | 390d32a6b130 |
children | ac4dd1d0ee39 |
line wrap: on
line diff
--- a/src/blist.c Sun Jun 22 17:08:52 2003 +0000 +++ b/src/blist.c Mon Jun 23 02:00:15 2003 +0000 @@ -1139,8 +1139,21 @@ g_snprintf(path, sizeof(path), "%s", filename); } else { char *g_screenname = get_screenname_filename(account->username); + const char *username; char *file = gaim_user_dir(); - int protocol = (account->protocol == GAIM_PROTO_OSCAR) ? (isalpha(account->username[0]) ? GAIM_PROTO_TOC : GAIM_PROTO_ICQ): account->protocol; + GaimProtocol prpl_num; + int protocol; + + prpl_num = gaim_account_get_protocol(account); + + protocol = prpl_num; + + if (prpl_num == GAIM_PROTO_OSCAR) { + if ((username = gaim_account_get_username(account)) != NULL) { + protocol = (isalpha(*username) + ? GAIM_PROTO_TOC : GAIM_PROTO_ICQ); + } + } if (file != (char *)NULL) { snprintf(path, PATHSIZE, "%s" G_DIR_SEPARATOR_S "%s.%d.blist", file, g_screenname, protocol); @@ -1728,7 +1741,8 @@ fprintf(file, "\t\t\t<person name=\"%s\">\n", bud_alias ? bud_alias : bud_name); fprintf(file, "\t\t\t\t<buddy protocol=\"%d\" " - "account=\"%s\">\n", bud->account->protocol, + "account=\"%s\">\n", + gaim_account_get_protocol(bud->account), acct_name); fprintf(file, "\t\t\t\t\t<name>%s</name>\n", bud_name); if(bud_alias) { @@ -1747,7 +1761,9 @@ struct chat *chat = (struct chat *)bnode; if(!exp_acct || chat->account == exp_acct) { char *acct_name = g_markup_escape_text(chat->account->username, -1); - fprintf(file, "\t\t\t<chat protocol=\"%d\" account=\"%s\">\n", chat->account->protocol, acct_name); + fprintf(file, "\t\t\t<chat protocol=\"%d\" account=\"%s\">\n", + gaim_account_get_protocol(chat->account), + acct_name); if(chat->alias) { char *chat_alias = g_markup_escape_text(chat->alias, -1); fprintf(file, "\t\t\t\t<alias>%s</alias>\n", chat_alias); @@ -1779,7 +1795,8 @@ char *acct_name = g_markup_escape_text(account->username, -1); if(!exp_acct || account == exp_acct) { fprintf(file, "\t\t<account protocol=\"%d\" name=\"%s\" " - "mode=\"%d\">\n", account->protocol, acct_name, account->perm_deny); + "mode=\"%d\">\n", gaim_account_get_protocol(account), + acct_name, account->perm_deny); for(buds = account->permit; buds; buds = buds->next) { char *bud_name = g_markup_escape_text(buds->data, -1); fprintf(file, "\t\t\t<permit>%s</permit>\n", bud_name);