/soc/2013/ankitkv/gobjectification: c5b444d1447d: Changed prefix...
Ankit Vani
a at nevitus.org
Fri Sep 6 07:47:08 EDT 2013
Changeset: c5b444d1447d89034e394664362d64a36c47fe58
Author: Ankit Vani <a at nevitus.org>
Date: 2013-09-06 17:16 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/c5b444d1447d
Description:
Changed prefix of PurpleXferType enums to PURPLE_XFER_TYPE_*
diffstat:
finch/gntft.c | 4 +-
libpurple/protocols/bonjour/bonjour_ft.c | 12 +++---
libpurple/protocols/irc/dcc_send.c | 4 +-
libpurple/protocols/jabber/oob.c | 2 +-
libpurple/protocols/jabber/si.c | 22 +++++-----
libpurple/protocols/msn/ft.c | 6 +-
libpurple/protocols/msn/msn.c | 2 +-
libpurple/protocols/msn/slpcall.c | 4 +-
libpurple/protocols/msn/slplink.c | 2 +-
libpurple/protocols/mxit/filexfer.c | 10 ++--
libpurple/protocols/oscar/oscar.c | 2 +-
libpurple/protocols/oscar/peer.c | 4 +-
libpurple/protocols/sametime/sametime.c | 6 +-
libpurple/protocols/silc/ft.c | 4 +-
libpurple/protocols/yahoo/yahoo_filexfer.c | 14 +++---
libpurple/xfer.c | 58 +++++++++++++++---------------
libpurple/xfer.h | 6 +-
pidgin/gtkft.c | 12 +++---
18 files changed, 87 insertions(+), 87 deletions(-)
diffs (truncated from 799 to 300 lines):
diff --git a/finch/gntft.c b/finch/gntft.c
--- a/finch/gntft.c
+++ b/finch/gntft.c
@@ -317,7 +317,7 @@ finch_xfer_dialog_add_xfer(PurpleXfer *x
lfilename = utf8;
gnt_tree_add_row_last(GNT_TREE(xfer_dialog->tree), xfer,
gnt_tree_create_row(GNT_TREE(xfer_dialog->tree),
- "0.0", (type == PURPLE_XFER_RECEIVE) ? purple_xfer_get_filename(xfer) : lfilename,
+ "0.0", (type == PURPLE_XFER_TYPE_RECEIVE) ? purple_xfer_get_filename(xfer) : lfilename,
size_str, "0.0", "",_("Waiting for transfer to begin")), NULL);
g_free(lfilename);
@@ -427,7 +427,7 @@ finch_xfer_dialog_update_xfer(PurpleXfer
}
data->last_updated_time = current_time;
- send = (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND);
+ send = (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND);
size_str = purple_str_size_to_units(purple_xfer_get_size(xfer));
remaining_str = purple_str_size_to_units(purple_xfer_get_bytes_remaining(xfer));
kbsec = g_strdup_printf(_("%.2f KiB/s"), kbps);
diff --git a/libpurple/protocols/bonjour/bonjour_ft.c b/libpurple/protocols/bonjour/bonjour_ft.c
--- a/libpurple/protocols/bonjour/bonjour_ft.c
+++ b/libpurple/protocols/bonjour/bonjour_ft.c
@@ -134,7 +134,7 @@ static void bonjour_xfer_end(PurpleXfer
/* We can't allow the server side to close the connection until the client is complete,
* otherwise there is a RST resulting in an error on the client side */
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND && purple_xfer_is_completed(xfer)) {
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND && purple_xfer_is_completed(xfer)) {
struct socket_cleanup *sc = g_new0(struct socket_cleanup, 1);
sc->fd = purple_xfer_get_fd(xfer);
purple_xfer_set_fd(xfer, -1);
@@ -355,7 +355,7 @@ bonjour_new_xfer(PurpleConnection *gc, c
return NULL;
/* Build the file transfer handle */
- xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who);
+ xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_TYPE_SEND, who);
xep_xfer = g_new0(XepXfer, 1);
purple_xfer_set_protocol_data(xfer, xep_xfer);
xep_xfer->data = bd;
@@ -416,14 +416,14 @@ bonjour_xfer_init(PurpleXfer *xfer)
/* Assume it is the first IP. We could do something like keep track of which one is in use or something. */
if (bb->ips)
xf->buddy_ip = g_strdup(bb->ips->data);
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND) {
/* initiate file transfer, send SI offer. */
- purple_debug_info("bonjour", "Bonjour xfer type is PURPLE_XFER_SEND.\n");
+ purple_debug_info("bonjour", "Bonjour xfer type is PURPLE_XFER_TYPE_SEND.\n");
xep_ft_si_offer(xfer, purple_xfer_get_remote_user(xfer));
} else {
/* accept file transfer request, send SI result. */
xep_ft_si_result(xfer, purple_xfer_get_remote_user(xfer));
- purple_debug_info("bonjour", "Bonjour xfer type is PURPLE_XFER_RECEIVE.\n");
+ purple_debug_info("bonjour", "Bonjour xfer type is PURPLE_XFER_TYPE_RECEIVE.\n");
}
}
@@ -761,7 +761,7 @@ bonjour_xfer_receive(PurpleConnection *p
purple_debug_info("bonjour", "bonjour-xfer-receive.\n");
/* Build the file transfer handle */
- xfer = purple_xfer_new(purple_connection_get_account(pc), PURPLE_XFER_RECEIVE, from);
+ xfer = purple_xfer_new(purple_connection_get_account(pc), PURPLE_XFER_TYPE_RECEIVE, from);
xf = g_new0(XepXfer, 1);
purple_xfer_set_protocol_data(xfer, xf);
xf->data = bd;
diff --git a/libpurple/protocols/irc/dcc_send.c b/libpurple/protocols/irc/dcc_send.c
--- a/libpurple/protocols/irc/dcc_send.c
+++ b/libpurple/protocols/irc/dcc_send.c
@@ -111,7 +111,7 @@ void irc_dccsend_recv(struct irc_conn *i
}
i++;
- xfer = purple_xfer_new(irc->account, PURPLE_XFER_RECEIVE, from);
+ xfer = purple_xfer_new(irc->account, PURPLE_XFER_TYPE_RECEIVE, from);
if (xfer)
{
xd = g_new0(struct irc_xfer_rx_data, 1);
@@ -355,7 +355,7 @@ PurpleXfer *irc_dccsend_new_xfer(PurpleC
struct irc_xfer_send_data *xd;
/* Build the file transfer handle */
- xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who);
+ xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_TYPE_SEND, who);
if (xfer)
{
xd = g_new0(struct irc_xfer_send_data, 1);
diff --git a/libpurple/protocols/jabber/oob.c b/libpurple/protocols/jabber/oob.c
--- a/libpurple/protocols/jabber/oob.c
+++ b/libpurple/protocols/jabber/oob.c
@@ -190,7 +190,7 @@ void jabber_oob_parse(JabberStream *js,
return;
xfer = purple_xfer_new(purple_connection_get_account(js->gc),
- PURPLE_XFER_RECEIVE, from);
+ PURPLE_XFER_TYPE_RECEIVE, from);
if (!xfer) {
g_free(url);
return;
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -143,7 +143,7 @@ jabber_si_bytestreams_connect_cb(gpointe
}
/* unknown file transfer type is assumed to be RECEIVE */
- if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND)
+ if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND)
{
xmlnode *activate;
iq = jabber_iq_new_query(jsx->js, JABBER_IQ_SET, NS_BYTESTREAMS);
@@ -247,7 +247,7 @@ static void jabber_si_bytestreams_attemp
/* if we are the sender, open an IBB session, but not if we already
did it, since we could have received the error <iq/> from the
receiver already... */
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND
&& !jsx->ibb_session) {
jabber_si_xfer_ibb_send_init(jsx->js, xfer);
} else {
@@ -293,7 +293,7 @@ static void jabber_si_bytestreams_attemp
purple_proxy_info_set_port(jsx->gpi, streamhost->port);
/* unknown file transfer type is assumed to be RECEIVE */
- if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND)
+ if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND)
dstaddr = g_strdup_printf("%s%s@%s/%s%s@%s/%s", jsx->stream_id, jsx->js->user->node, jsx->js->user->domain,
jsx->js->user->resource, dstjid->node, dstjid->domain, dstjid->resource);
else
@@ -311,7 +311,7 @@ static void jabber_si_bytestreams_attemp
g_free(dstaddr);
/* When selecting a streamhost, timeout after STREAMHOST_CONNECT_TIMEOUT seconds, otherwise it takes forever */
- if (purple_xfer_get_xfer_type(xfer) != PURPLE_XFER_SEND && jsx->connect_data != NULL)
+ if (purple_xfer_get_xfer_type(xfer) != PURPLE_XFER_TYPE_SEND && jsx->connect_data != NULL)
jsx->connect_timeout = purple_timeout_add_seconds(
STREAMHOST_CONNECT_TIMEOUT, connect_timeout_cb, xfer);
@@ -734,7 +734,7 @@ jabber_si_connect_proxy_cb(JabberStream
/* if we are the sender and haven't already opened an IBB
session, do so now (we might already have failed to open
the bytestream proxy ourselves when receiving this <iq/> */
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND
&& !jsx->ibb_session) {
jabber_si_xfer_ibb_send_init(js, xfer);
} else {
@@ -776,7 +776,7 @@ jabber_si_connect_proxy_cb(JabberStream
if (jsx->stream_method & STREAM_METHOD_IBB) {
purple_debug_info("jabber",
"jabber_si_connect_proxy_cb: trying to revert to IBB\n");
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND) {
jabber_si_xfer_ibb_send_init(jsx->js, xfer);
} else {
jsx->ibb_timeout_handle = purple_timeout_add_seconds(30,
@@ -926,7 +926,7 @@ jabber_si_xfer_bytestreams_listen_cb(int
if (jsx->stream_method & STREAM_METHOD_IBB) {
purple_debug_info("jabber",
"jabber_si_xfer_bytestreams_listen_cb: trying to revert to IBB\n");
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND) {
/* if we are the sender, init the IBB session... */
jabber_si_xfer_ibb_send_init(jsx->js, xfer);
} else {
@@ -1313,7 +1313,7 @@ static void jabber_si_xfer_free(PurpleXf
jabber_iq_remove_callback_by_id(js, jsx->iq_id);
if (jsx->local_streamhost_fd >= 0)
close(jsx->local_streamhost_fd);
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND && purple_xfer_get_fd(xfer) >= 0) {
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND && purple_xfer_get_fd(xfer) >= 0) {
purple_debug_info("jabber", "remove port mapping\n");
purple_network_remove_port_mapping(purple_xfer_get_fd(xfer));
}
@@ -1500,7 +1500,7 @@ static void jabber_si_xfer_init(PurpleXf
{
JabberSIXfer *jsx = purple_xfer_get_protocol_data(xfer);
JabberIq *iq;
- if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND) {
+ if(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND) {
JabberBuddy *jb;
JabberBuddyResource *jbr = NULL;
char *resource;
@@ -1628,7 +1628,7 @@ PurpleXfer *jabber_si_new_xfer(PurpleCon
js = purple_connection_get_protocol_data(gc);
- xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who);
+ xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_TYPE_SEND, who);
if (xfer)
{
jsx = g_new0(JabberSIXfer, 1);
@@ -1754,7 +1754,7 @@ void jabber_si_parse(JabberStream *js, c
jsx->stream_id = g_strdup(stream_id);
jsx->iq_id = g_strdup(id);
- xfer = purple_xfer_new(purple_connection_get_account(js->gc), PURPLE_XFER_RECEIVE, from);
+ xfer = purple_xfer_new(purple_connection_get_account(js->gc), PURPLE_XFER_TYPE_RECEIVE, from);
g_return_if_fail(xfer != NULL);
purple_xfer_set_protocol_data(xfer, jsx);
diff --git a/libpurple/protocols/msn/ft.c b/libpurple/protocols/msn/ft.c
--- a/libpurple/protocols/msn/ft.c
+++ b/libpurple/protocols/msn/ft.c
@@ -83,7 +83,7 @@ msn_xfer_cancel(PurpleXfer *xfer)
g_free(content);
msn_slplink_send_queued_slpmsgs(slpcall->slplink);
- if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND)
+ if (purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND)
slpcall->wasted = TRUE;
else
msn_slpcall_destroy(slpcall);
@@ -100,7 +100,7 @@ msn_xfer_write(const guchar *data, gsize
g_return_val_if_fail(data != NULL, -1);
g_return_val_if_fail(len > 0, -1);
- g_return_val_if_fail(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_SEND, -1);
+ g_return_val_if_fail(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_SEND, -1);
slpcall = purple_xfer_get_protocol_data(xfer);
/* Not sure I trust it'll be there */
@@ -124,7 +124,7 @@ msn_xfer_read(guchar **data, PurpleXfer
g_return_val_if_fail(xfer != NULL, -1);
g_return_val_if_fail(data != NULL, -1);
- g_return_val_if_fail(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_RECEIVE, -1);
+ g_return_val_if_fail(purple_xfer_get_xfer_type(xfer) == PURPLE_XFER_TYPE_RECEIVE, -1);
slpcall = purple_xfer_get_protocol_data(xfer);
/* Not sure I trust it'll be there */
diff --git a/libpurple/protocols/msn/msn.c b/libpurple/protocols/msn/msn.c
--- a/libpurple/protocols/msn/msn.c
+++ b/libpurple/protocols/msn/msn.c
@@ -883,7 +883,7 @@ msn_new_xfer(PurpleConnection *gc, const
session = purple_connection_get_protocol_data(gc);
- xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_SEND, who);
+ xfer = purple_xfer_new(purple_connection_get_account(gc), PURPLE_XFER_TYPE_SEND, who);
g_return_val_if_fail(xfer != NULL, NULL);
diff --git a/libpurple/protocols/msn/slpcall.c b/libpurple/protocols/msn/slpcall.c
--- a/libpurple/protocols/msn/slpcall.c
+++ b/libpurple/protocols/msn/slpcall.c
@@ -111,7 +111,7 @@ msn_slpcall_destroy(MsnSlpCall *slpcall)
slpcall->end_cb(slpcall, slpcall->slplink->session);
if (slpcall->xfer != NULL) {
- if (purple_xfer_get_xfer_type(slpcall->xfer) == PURPLE_XFER_RECEIVE)
+ if (purple_xfer_get_xfer_type(slpcall->xfer) == PURPLE_XFER_TYPE_RECEIVE)
g_byte_array_free(slpcall->u.incoming_data, TRUE);
purple_xfer_set_protocol_data(slpcall->xfer, NULL);
g_object_unref(slpcall->xfer);
@@ -521,7 +521,7 @@ got_sessionreq(MsnSlpCall *slpcall, cons
slpcall->pending = TRUE;
- xfer = purple_xfer_new(account, PURPLE_XFER_RECEIVE,
+ xfer = purple_xfer_new(account, PURPLE_XFER_TYPE_RECEIVE,
slpcall->slplink->remote_user);
buf = (char *)purple_base64_decode(context, &bin_len);
diff --git a/libpurple/protocols/msn/slplink.c b/libpurple/protocols/msn/slplink.c
--- a/libpurple/protocols/msn/slplink.c
+++ b/libpurple/protocols/msn/slplink.c
@@ -304,7 +304,7 @@ msn_slplink_send_msgpart(MsnSlpLink *slp
offset = msn_p2p_info_get_offset(info);
if (offset < real_size)
{
- if (slpmsg->slpcall && slpmsg->slpcall->xfer && purple_xfer_get_xfer_type(slpmsg->slpcall->xfer) == PURPLE_XFER_SEND &&
+ if (slpmsg->slpcall && slpmsg->slpcall->xfer && purple_xfer_get_xfer_type(slpmsg->slpcall->xfer) == PURPLE_XFER_TYPE_SEND &&
purple_xfer_get_status(slpmsg->slpcall->xfer) == PURPLE_XFER_STATUS_STARTED)
{
len = MIN(MSN_SBCONN_MAX_SIZE, slpmsg->slpcall->u.outgoing.len);
diff --git a/libpurple/protocols/mxit/filexfer.c b/libpurple/protocols/mxit/filexfer.c
--- a/libpurple/protocols/mxit/filexfer.c
+++ b/libpurple/protocols/mxit/filexfer.c
@@ -122,7 +122,7 @@ static void mxit_xfer_init( PurpleXfer*
purple_debug_info( MXIT_PLUGIN_ID, "mxit_xfer_init\n" );
- if ( purple_xfer_get_xfer_type( xfer ) == PURPLE_XFER_SEND ) {
+ if ( purple_xfer_get_xfer_type( xfer ) == PURPLE_XFER_TYPE_SEND ) {
/* we are trying to send a file to MXit */
if ( purple_xfer_get_size( xfer ) > CP_MAX_FILESIZE ) {
@@ -158,7 +158,7 @@ static void mxit_xfer_start( PurpleXfer*
purple_debug_info( MXIT_PLUGIN_ID, "mxit_xfer_start\n" );
- if ( purple_xfer_get_xfer_type( xfer ) == PURPLE_XFER_SEND ) {
+ if ( purple_xfer_get_xfer_type( xfer ) == PURPLE_XFER_TYPE_SEND ) {
/*
* the user wants to send a file to one of his contacts. we need to create
* a buffer and copy the file data into memory and then we can send it to
More information about the Commits
mailing list