aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/purple/purple.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/purple/purple.c')
-rw-r--r--protocols/purple/purple.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c
index 6ea2d7d8..589cc093 100644
--- a/protocols/purple/purple.c
+++ b/protocols/purple/purple.c
@@ -278,6 +278,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);
@@ -365,6 +377,8 @@ static void purple_logout(struct im_connection *ic)
imcb_chat_free(ic->groupchats->data);
}
+ purple_save_password(ic->acc, pd->account);
+
purple_account_set_enabled(pd->account, "BitlBee", FALSE);
purple_connections = g_slist_remove(purple_connections, ic);
purple_accounts_remove(pd->account);
@@ -1535,8 +1549,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);
}
register_protocol(ret);
@@ -1544,12 +1558,12 @@ 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";
ret->data = prot->info->id;
register_protocol(ret);
- }
+ }*/
}
g_string_append(help, "\n\nFor used protocols, more information about available "