/soc/2013/ashmew2/filetransferY: 045cd751306b: Fixed Space/Tab i...
Ashish Gupta
ashmew2 at gmail.com
Mon Feb 3 06:13:13 EST 2014
Changeset: 045cd751306bc1490e5a426f10d1e5b2022474cd
Author: Ashish Gupta <ashmew2 at gmail.com>
Date: 2014-02-03 16:41 +0530
Branch: default
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferY/rev/045cd751306b
Description:
Fixed Space/Tab indents and Line wraps
diffstat:
libpurple/protocols/jabber/disco.c | 1 -
libpurple/protocols/jabber/google/google_session.c | 316 ++--
libpurple/protocols/jabber/google/google_session.h | 101 +-
libpurple/protocols/jabber/google/google_share.c | 1142 +++++++++----------
libpurple/protocols/jabber/jabber.c | 7 +-
libpurple/protocols/jabber/si.c | 3 -
6 files changed, 725 insertions(+), 845 deletions(-)
diffs (truncated from 2558 to 300 lines):
diff --git a/libpurple/protocols/jabber/disco.c b/libpurple/protocols/jabber/disco.c
--- a/libpurple/protocols/jabber/disco.c
+++ b/libpurple/protocols/jabber/disco.c
@@ -143,7 +143,6 @@ void jabber_disco_info_parse(JabberStrea
}
}
} else if (g_str_equal(node, CAPS0115_NODE "#" "share-v1")) {
-
PurpleXmlNode *feature = purple_xmlnode_new_child(query, "feature");
purple_xmlnode_set_attrib(feature, "var", NS_GOOGLE_SHARE);
#ifdef USE_VV
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
@@ -49,29 +49,28 @@ google_session_id_equal(gconstpointer a,
void
google_session_destroy(GoogleSession *session)
{
- JabberStream *js = session->js;
- session->state = TERMINATED;
-
- if(session->share) {
-
+ JabberStream *js = session->js;
+ session->state = TERMINATED;
+
+ if (session->share) {
GoogleXferSessionData *share_session = session->session_data;
GSList *temp = NULL;
-
- if(share_session->xfer) {
- if(purple_xfer_get_status(share_session->xfer) ==
- PURPLE_XFER_STATUS_CANCEL_REMOTE) {
- purple_xfer_cancel_remote(share_session->xfer);
+
+ if (share_session->xfer) {
+ if (purple_xfer_get_status(share_session->xfer) ==
+ PURPLE_XFER_STATUS_CANCEL_REMOTE) {
+ purple_xfer_cancel_remote(share_session->xfer);
}
- else if (purple_xfer_get_status(share_session->xfer)
- != PURPLE_XFER_STATUS_CANCEL_LOCAL &&
- purple_xfer_get_status(share_session->xfer)
- != PURPLE_XFER_STATUS_DONE) {
- purple_xfer_cancel_local(share_session->xfer);
+ else if (purple_xfer_get_status(share_session->xfer)
+ != PURPLE_XFER_STATUS_CANCEL_LOCAL &&
+ purple_xfer_get_status(share_session->xfer)
+ != PURPLE_XFER_STATUS_DONE) {
+ purple_xfer_cancel_local(share_session->xfer);
}
}
-
- if(share_session->file_to_send)
- fclose(share_session->file_to_send);
+
+ if (share_session->file_to_send)
+ fclose(share_session->file_to_send);
share_session->xfer = NULL;
g_free(share_session->filename);
@@ -80,54 +79,55 @@ google_session_destroy(GoogleSession *se
g_free(share_session->file_buf);
g_free(share_session->channel_name);
- if(share_session->share_agent) {
+ if (share_session->share_agent) {
g_signal_handlers_disconnect_by_func(
G_OBJECT(share_session->share_agent),
G_CALLBACK(cb_candidate_gathering_done),
session);
-
+
g_signal_handlers_disconnect_by_func(
G_OBJECT(share_session->share_agent),
G_CALLBACK (cb_new_selected_pair), NULL);
-
+
g_signal_handlers_disconnect_by_func(
G_OBJECT(share_session->share_agent),
G_CALLBACK (cb_nice_component_state_changed),
session);
-
+
g_signal_handlers_disconnect_by_func(
G_OBJECT(share_session->share_agent),
- G_CALLBACK (cb_nice_component_writable),
- share_session);
+ G_CALLBACK (cb_nice_component_writable),
+ share_session);
g_object_unref(share_session->share_agent);
}
-
+
purple_circ_buffer_destroy(share_session->buffer);
-
+
for (temp = share_session->remote_share_candidates; temp; temp =
g_slist_delete_link(temp, temp)) {
nice_candidate_free(temp->data);
}
-
+
for (temp = share_session->local_share_candidates; temp; temp =
g_slist_delete_link(temp, temp)) {
nice_candidate_free(temp->data);
}
-
- g_free(temp);
+
+ g_free(temp);
}
else { /*If it is an AV session*/
GoogleAVSessionData *session_data = session->session_data;
if (session_data->remote_audio_candidates)
purple_media_candidate_list_free(
session_data->remote_audio_candidates);
-
+
if (session_data->remote_video_candidates)
purple_media_candidate_list_free(
session_data->remote_video_candidates);
}
-
- js->google_share_sessions = g_list_remove(js->google_share_sessions,session);
+
+ js->google_share_sessions =
+ g_list_remove(js->google_share_sessions,session);
g_free(session->id.id);
g_free(session->id.initiator);
@@ -243,7 +243,7 @@ google_session_ready(GoogleSession *sess
((GoogleAVSessionData *)session->session_data)->media;
gboolean video =
((GoogleAVSessionData *)session->session_data)->video;
- gboolean share = session->share;
+ gboolean share = session->share;
if (purple_media_codecs_ready(media, NULL) &&
purple_media_candidates_prepared(media, NULL, NULL)) {
gchar *me = g_strdup_printf("%s@%s/%s",
@@ -281,7 +281,7 @@ google_session_ready(GoogleSession *sess
purple_xmlnode_insert_child(iq->node, sess);
desc = purple_xmlnode_new_child(sess, "description");
if (share)
- purple_xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_SHARE);
+ purple_xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_SHARE);
else if (video)
purple_xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_VIDEO);
else
@@ -418,73 +418,66 @@ jabber_google_session_get_params(JabberS
void
jabber_google_relay_response_session_initiate_cb(GoogleSession *session,
- const gchar *relay_ip, guint relay_udp, guint relay_tcp, guint relay_ssltcp,
- const gchar *relay_username, const gchar *relay_password)
+ const gchar *relay_ip, guint relay_udp, guint relay_tcp, guint relay_ssltcp,
+ const gchar *relay_username, const gchar *relay_password)
{
- JabberStream *js = session->js;
+ JabberStream *js = session->js;
- if(session->share) {
+ if (session->share) {
GoogleXferSessionData *share_session =
- (GoogleXferSessionData *)session->session_data;
+ (GoogleXferSessionData *)session->session_data;
gint stream_id = share_session->stream_id;
NiceAgent *agent = share_session->share_agent;
- purple_debug_info("Google_session", "Here\n\n\n\n");
-
- if(!agent) {
-/* if(purple_xfer_get_type(share_session->xfer) == PURPLE_XFER_RECEIVE)
- purple_xfer_request(share_session->xfer);
-*/ /*if xfer is of type PURPLE_XFER_SEND, We've already requested it*/
-
+ if (!agent) {
stream_id = gtalk_xfer_init_agent(session);
agent = share_session->share_agent;
- purple_debug_info("google_session", "share_agent created with stream id : %d!\n", stream_id);
-
- if(js->stun_ip) {
+ if (js->stun_ip) {
g_object_set(G_OBJECT (agent), "stun-server", js->stun_ip, NULL);
g_object_set(G_OBJECT (agent), "stun-server-port", js->stun_port, NULL);
}
}
- else
- purple_debug_info("google_session", "share_agent is already initialized!..\n");
+ else
+ purple_debug_info("google_session", "share_agent is already initialized!..\n");
if (relay_ip) {
if (relay_udp)
- nice_agent_set_relay_info(agent, share_session->stream_id, 1, relay_ip, relay_udp,
- relay_username, relay_password, NICE_RELAY_TYPE_TURN_UDP);
+ nice_agent_set_relay_info(agent, share_session->stream_id,
+ 1, relay_ip, relay_udp, relay_username,
+ relay_password, NICE_RELAY_TYPE_TURN_UDP);
if (relay_tcp)
- nice_agent_set_relay_info(agent, share_session->stream_id, 1, relay_ip, relay_tcp,
- relay_username, relay_password, NICE_RELAY_TYPE_TURN_TCP);
+ nice_agent_set_relay_info(agent, share_session->stream_id,
+ 1, relay_ip, relay_tcp, relay_username,
+ relay_password, NICE_RELAY_TYPE_TURN_TCP);
if (relay_ssltcp)
- nice_agent_set_relay_info(agent, share_session->stream_id, 1, relay_ip, relay_ssltcp,
- relay_username, relay_password, NICE_RELAY_TYPE_TURN_TLS);
+ nice_agent_set_relay_info(agent, share_session->stream_id,
+ 1, relay_ip, relay_ssltcp, relay_username,
+ relay_password, NICE_RELAY_TYPE_TURN_TLS);
}
-
+
session->relay_processing = FALSE;
- if(session->session_should_die) {
- purple_debug_info("google_session","Detected session_should_die as 1.\n");
- google_session_destroy(session);
- return;
+ if (session->session_should_die) {
+ google_session_destroy(session);
+ return;
}
return;
}
else {
-
GParameter *params;
guint num_params;
-
+
GoogleAVSessionData *session_data =
(GoogleAVSessionData *) session->session_data;
-
+
session_data->media = purple_media_manager_create_media(
purple_media_manager_get(),
purple_connection_get_account(js->gc),
"fsrtpconference", session->remote_jid, TRUE);
-
+
purple_media_set_prpl_data(session_data->media, session);
-
+
g_signal_connect_swapped(G_OBJECT(session_data->media),
"candidates-prepared",
G_CALLBACK(google_session_ready), session);
@@ -495,24 +488,24 @@ jabber_google_relay_response_session_ini
g_signal_connect(G_OBJECT(session_data->media), "stream-info",
G_CALLBACK(google_session_stream_info_cb), session);
- params =
- jabber_google_session_get_params(js, relay_ip, relay_udp,
- relay_tcp, relay_ssltcp,
- relay_username, relay_password,
+ params =
+ jabber_google_session_get_params(js, relay_ip, relay_udp,
+ relay_tcp, relay_ssltcp,
+ relay_username, relay_password,
&num_params);
-
+
if (purple_media_add_stream(session_data->media, "google-voice",
- session->remote_jid, PURPLE_MEDIA_AUDIO,
- TRUE, "nice", num_params, params) == FALSE ||
- (session_data->video && purple_media_add_stream(
- session_data->media, "google-video",
- session->remote_jid, PURPLE_MEDIA_VIDEO,
- TRUE, "nice", num_params, params) == FALSE)) {
+ session->remote_jid, PURPLE_MEDIA_AUDIO,
+ TRUE, "nice", num_params, params) == FALSE ||
+ (session_data->video && purple_media_add_stream(
+ session_data->media, "google-video",
+ session->remote_jid, PURPLE_MEDIA_VIDEO,
+ TRUE, "nice", num_params, params) == FALSE)) {
purple_media_error(session_data->media, "Error adding stream.");
purple_media_end(session_data->media, NULL, NULL);
- } else
- session_data->added_streams = TRUE;
-
+ } else
+ session_data->added_streams = TRUE;
+
g_free(params);
}
}
@@ -713,7 +706,7 @@ google_session_handle_initiate(JabberStr
GoogleAVSessionData *session_data =
(GoogleAVSessionData *) session->session_data;
session_data = g_new0(GoogleAVSessionData, 1);
-
+
session_data->video = video;
session_data->media = purple_media_manager_create_media(
purple_media_manager_get(),
@@ -736,15 +729,15 @@ google_session_handle_initiate(JabberStr
if (js->google_relay_host && js->google_relay_token) {
More information about the Commits
mailing list