/soc/2013/ashmew2/filetransferX: d2fccc5fbdca: nice_component_st...

Ashish Gupta ashmew2 at gmail.com
Sun Aug 18 07:53:45 EDT 2013


Changeset: d2fccc5fbdcad09269e1762e55cad1a47abeee89
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-08-17 04:11 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/d2fccc5fbdca

Description:

nice_component_state_to_str added

diffstat:

 libpurple/protocols/jabber/google/google_session.c |  28 +++++++++++++++++++--
 1 files changed, 25 insertions(+), 3 deletions(-)

diffs (40 lines):

diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c
--- a/libpurple/protocols/jabber/google/google_session.c
+++ b/libpurple/protocols/jabber/google/google_session.c
@@ -1349,11 +1349,33 @@ cb_nice_recv(NiceAgent *agent, guint str
 //dummy function
 }
 
-void cb_nice_component_state_changed((NiceAgent *agent,guint stream_id, guint component_id,
+char *nice_component_state_to_str(guint state)
+{
+	switch(state) {
+
+	case NICE_COMPONENT_STATE_DISCONNECTED : return "NICE_COMPONENT_STATE_DISCONNECTED";
+		
+	case NICE_COMPONENT_STATE_GATHERING : return "NICE_COMPONENT_STATE_GATHERING";
+
+	case NICE_COMPONENT_STATE_CONNECTING : return "NICE_COMPONENT_STATE_CONNECTING";
+
+	case NICE_COMPONENT_STATE_CONNECTED : return "NICE_COMPONENT_STATE_CONNECTED";
+
+	case NICE_COMPONENT_STATE_READY : return "NICE_COMPONENT_STATE_READY";
+
+	case NICE_COMPONENT_STATE_FAILED : return "NICE_COMPONENT_STATE_FAILED";
+
+	case NICE_COMPONENT_STATE_LAST : return "NICE_COMPONENT_STATE_LAST";
+
+	default: return "UNKOWN STATE";
+	}
+}
+
+void cb_nice_component_state_changed(NiceAgent *agent,guint stream_id, guint component_id,
 				      guint state, gpointer user_data)
 {
-	purple_debug_info("google_session", "State of NiceAgent Changed...Current State : %u\n", state);
-/*TODO: Add more stuff related to state changes here*/
+	purple_debug_info("google_session", "State of NiceAgent Changed...Current State : %s\n", nice_component_state_to_str(state));
+	/*TODO: Add more stuff related to state changes here*/
 }
 
 void



More information about the Commits mailing list