diff src/prpl.c @ 11718:11e95968c9ff

[gaim-migrate @ 14009] PRPLs are no longer required to call gaim_account_connect() and gaim_account_disconnect()--it is done in the core. Having the PRPLs do it was kind of silly. And this should allow me to improve the auto-reconnect plugin some. I think. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 22 Oct 2005 20:09:24 +0000
parents e1e47878d0ed
children ef57eccb9a3b
line wrap: on
line diff
--- a/src/prpl.c	Sat Oct 22 19:56:02 2005 +0000
+++ b/src/prpl.c	Sat Oct 22 20:09:24 2005 +0000
@@ -289,6 +289,28 @@
 	g_return_if_fail(old_status != NULL);
 	g_return_if_fail(new_status != NULL);
 
+	if (gaim_account_is_connecting(account))
+		/*
+		 * We don't need to call the set_status PRPL function because
+		 * the PRPL will take care of setting its status during the
+		 * connection process.
+		 */
+		return;
+
+	if (gaim_status_is_online(new_status) &&
+		gaim_account_is_disconnected(account))
+	{
+		gaim_account_connect(account);
+		return;
+	}
+
+	if (!gaim_status_is_online(new_status) &&
+			 !gaim_account_is_disconnected(account))
+	{
+		gaim_account_disconnect(account);
+		return;
+	}
+
 	prpl = gaim_find_prpl(gaim_account_get_protocol_id(account));
 
 	if (prpl == NULL)