/soc/2013/ankitkv/gobjectification: 33722e7cda18: Added purple_c...

Ankit Vani a at nevitus.org
Sat Jul 13 13:05:46 EDT 2013


Changeset: 33722e7cda18953a3bc9cce62ec1b696c9b5f7af
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-13 22:31 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/33722e7cda18

Description:

Added purple_connection_disable_reconnection() for protocols to handle user registration queries.

diffstat:

 libpurple/connection.c              |  9 +++++++++
 libpurple/connection.h              |  9 +++++++++
 libpurple/protocols/jabber/jabber.c |  5 +----
 libpurple/protocols/jabber/parser.c |  2 +-
 4 files changed, 20 insertions(+), 5 deletions(-)

diffs (65 lines):

diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -550,6 +550,15 @@ void purple_connection_update_last_recei
 	priv->last_received = time(NULL);
 }
 
+void purple_connection_disable_reconnection(PurpleConnection *gc)
+{
+	PurpleConnectionPrivate *priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
+
+	g_return_if_fail(priv != NULL);
+
+	priv->wants_to_die = TRUE;
+}
+
 /**************************************************************************
  * GBoxed code
  **************************************************************************/
diff --git a/libpurple/connection.h b/libpurple/connection.h
--- a/libpurple/connection.h
+++ b/libpurple/connection.h
@@ -463,6 +463,15 @@ purple_connection_error_is_fatal (Purple
  */
 void purple_connection_update_last_received(PurpleConnection *gc);
 
+/**
+ * Disables reconnection after the connection disconnects.
+ * Called by prpls in handling of queries for user registration. This is not
+ * required when implementing prpl_info->register_user.
+ *
+ * @param gc   The connection.
+ */
+void purple_connection_disable_reconnection(PurpleConnection *gc);
+
 /*@}*/
 
 /**************************************************************************/
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -1377,10 +1377,7 @@ void jabber_register_parse(JabberStream 
 				g_free(href);
 
 				if(js->registration) {
-#warning Is this (gc->wants_to_die) required here? If so, an alternative needed.
-#if 0
-					js->gc->wants_to_die = TRUE;
-#endif
+					purple_connection_disable_reconnection(js->gc);
 					/* succeeded, but we have no login info */
 					purple_account_register_completed(account, TRUE);
 					jabber_connection_schedule_close(js);
diff --git a/libpurple/protocols/jabber/parser.c b/libpurple/protocols/jabber/parser.c
--- a/libpurple/protocols/jabber/parser.c
+++ b/libpurple/protocols/jabber/parser.c
@@ -309,7 +309,7 @@ void jabber_parser_process(JabberStream 
 
 	if (js->protocol_version.major == 0 && js->protocol_version.minor == 9 &&
 #if 0
-			/* FIXME: Is this required here? */
+			/* FIXME  Is this required here? */
 			!js->gc->disconnect_timeout &&
 #endif
 			(js->state == JABBER_STREAM_INITIALIZING ||



More information about the Commits mailing list