diff options
Diffstat (limited to 'protocols/purple/purple.c')
-rw-r--r-- | protocols/purple/purple.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 5d935028..25cd00cf 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -328,6 +328,18 @@ static void purple_init(account_t *acc) purple_accounts_remove(pa); } +static void purple_save_password(account_t *acc, PurpleAccount *pa) +{ + char *old_password, *new_password; + + old_password = set_getstr(&acc->set, "password"); + new_password = g_strdup(purple_account_get_password(pa)); + if (!old_password || !*old_password || g_strcmp0(old_password, new_password) != 0) { + set_setstr(&acc->set, "password", new_password); + } + g_free(new_password); +} + static void purple_sync_settings(account_t *acc, PurpleAccount *pa) { PurplePlugin *prpl = purple_plugins_find_with_id(pa->protocol_id); @@ -424,6 +436,8 @@ static void purple_logout(struct im_connection *ic) imcb_chat_free(ic->groupchats->data); } + purple_save_password(ic->acc, pd->account); + if (pd->filetransfers) { purple_transfer_cancel_all(ic); } @@ -1902,8 +1916,8 @@ void purple_initmodule() ret = g_memdup(&funcs, sizeof(funcs)); ret->name = ret->data = prot->info->id; - if (strncmp(ret->name, "prpl-", 5) == 0) { - ret->name += 5; + if (strncmp(ret->name, "prpl-", 5) != 0) { + ret->name = g_strdup_printf("prpl-%s", ret->name); } if (pi->options & OPT_PROTO_NO_PASSWORD) { @@ -1920,13 +1934,13 @@ void purple_initmodule() /* libpurple doesn't define a protocol called OSCAR, but we need it to be compatible with normal BitlBee. */ - if (g_strcasecmp(prot->info->id, "prpl-aim") == 0) { + /*if (g_strcasecmp(prot->info->id, "prpl-aim") == 0) { ret = g_memdup(&funcs, sizeof(funcs)); ret->name = "oscar"; - /* purple_get_account_prpl_id() determines the actual protocol ID (icq/aim) */ + / * purple_get_account_prpl_id() determines the actual protocol ID (icq/aim) * / ret->data = NULL; register_protocol(ret); - } + }*/ info = g_new0(struct plugin_info, 1); info->abiver = BITLBEE_ABI_VERSION_CODE; |