Commit f6d9b6fe authored by Andrea Schaefer's avatar Andrea Schaefer

Merge branch 'fix-disconnect' into 'master'

Fix sms account disconnect

See merge request Librem5/chatty!133
parents 4ea3fb7c b5d8a04b
......@@ -517,6 +517,23 @@ chatty_get_selected_node (void) {
}
gboolean
chatty_blist_protocol_is_sms (PurpleAccount *account)
{
const gchar *protocol_id;
g_return_val_if_fail (account != NULL, FALSE);
protocol_id = purple_account_get_protocol_id (account);
if (g_strcmp0 (protocol_id, "prpl-mm-sms") == 0) {
return TRUE;
} else {
return FALSE;
}
}
/**
* chatty_blist_buddy_is_displayable:
* @buddy: a PurpleBuddy
......
......@@ -89,6 +89,7 @@ void chatty_blist_contact_list_add_buddy (void);
void chatty_blist_chat_list_leave_chat (void);
void chatty_blist_chat_list_remove_buddy (void);
int chatty_blist_list_has_children (int list_type);
gboolean chatty_blist_protocol_is_sms (PurpleAccount *account);
void chatty_blist_add_buddy_from_uri (const char *uri);
void chatty_blist_join_group_chat (PurpleAccount *account,
const char *group_chat_id,
......
......@@ -11,6 +11,7 @@
#include "purple.h"
#include "chatty-window.h"
#include "chatty-connection.h"
#include "chatty-buddy-list.h"
#include "chatty-purple-init.h"
#include "chatty-notify.h"
#include "chatty-dialogs.h"
......@@ -265,13 +266,15 @@ chatty_connection_network_disconnected (void)
while (l) {
PurpleAccount *a = (PurpleAccount*)l->data;
if (!purple_account_is_disconnected (a)) {
char *password = g_strdup(purple_account_get_password (a));
if (!chatty_blist_protocol_is_sms (a)) {
if (!purple_account_is_disconnected (a)) {
char *password = g_strdup(purple_account_get_password (a));
purple_account_disconnect (a);
purple_account_set_password (a, password);
purple_account_disconnect (a);
purple_account_set_password (a, password);
g_free (password);
g_free (password);
}
}
l = l->next;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment