/pidgin/main: 01ef7274b440: Gadu-Gadu: handle apropriate event w...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue Jan 7 13:26:20 EST 2014


Changeset: 01ef7274b4407ebf7feec2a1e9c687b9b3afda91
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-01-07 19:26 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/01ef7274b440

Description:

Gadu-Gadu: handle apropriate event when getting remotely disconnected from other session

diffstat:

 libpurple/protocols/gg/gg.c       |  3 +++
 libpurple/protocols/gg/servconn.c |  7 +++++++
 libpurple/protocols/gg/servconn.h |  1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diffs (37 lines):

diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -406,6 +406,9 @@ static void ggp_callback_recv(gpointer _
 			ggp_chat_got_event(gc, ev);
 			break;
 #endif
+		case GG_EVENT_DISCONNECT:
+			ggp_servconn_remote_disconnect(gc);
+			break;
 		default:
 			purple_debug_warning("gg",
 				"unsupported event type=%d\n", ev->type);
diff --git a/libpurple/protocols/gg/servconn.c b/libpurple/protocols/gg/servconn.c
--- a/libpurple/protocols/gg/servconn.c
+++ b/libpurple/protocols/gg/servconn.c
@@ -97,3 +97,10 @@ GSList * ggp_servconn_get_servers(void)
 	return ggp_list_copy_to_slist_deep(global_data.server_history,
 		(GCopyFunc)g_strdup, NULL);
 }
+
+void
+ggp_servconn_remote_disconnect(PurpleConnection *gc)
+{
+	purple_debug_info("gg", "Server remotely closes connection");
+	purple_account_disconnect(purple_connection_get_account(gc));
+}
diff --git a/libpurple/protocols/gg/servconn.h b/libpurple/protocols/gg/servconn.h
--- a/libpurple/protocols/gg/servconn.h
+++ b/libpurple/protocols/gg/servconn.h
@@ -38,5 +38,6 @@ void ggp_servconn_cleanup(void);
 
 void ggp_servconn_add_server(const gchar *server);
 GSList * ggp_servconn_get_servers(void);
+void ggp_servconn_remote_disconnect(PurpleConnection *gc);
 
 #endif /* _GGP_SERVCONN_H */



More information about the Commits mailing list