Mercurial > pidgin.yaz
diff libpurple/protocols/oscar/oft.c @ 32449:b6defcebfe4b
Steps toward hiding PurpleXfer.
To convert prpls as they are now, lot of new accessors are needed (for stuff
that maybe shouldn't be exposed directly).
To convert prpls so that they don't keep re-implementing the same type of
stuff, a lot of error-prone changes are needed.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 29 Aug 2011 22:55:51 +0000 |
parents | 7c65c7054905 |
children | 0f94ec89f0bc 8a29624609b0 |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oft.c Mon Aug 29 22:50:03 2011 +0000 +++ b/libpurple/protocols/oscar/oft.c Mon Aug 29 22:55:51 2011 +0000 @@ -362,10 +362,10 @@ if (purple_circ_buffer_get_max_read(conn->buffer_outgoing) == 0) { + int fd = conn->fd; conn->sending_data_timer = 0; - conn->xfer->fd = conn->fd; conn->fd = -1; - purple_xfer_start(conn->xfer, conn->xfer->fd, NULL, 0); + purple_xfer_start(conn->xfer, fd, NULL, 0); return FALSE; } @@ -665,9 +665,9 @@ size2 = purple_str_size_to_units(G_MAXUINT32); tmp = g_strdup_printf(_("File %s is %s, which is larger than " "the maximum size of %s."), - xfer->local_filename, size1, size2); + purple_xfer_get_local_filename(xfer), size1, size2); purple_xfer_error(purple_xfer_get_type(xfer), - purple_xfer_get_account(xfer), xfer->who, tmp); + purple_xfer_get_account(xfer), purple_xfer_get_remote_user(xfer), tmp); g_free(size1); g_free(size2); g_free(tmp); @@ -689,9 +689,9 @@ strncpy((gchar *)conn->xferdata.idstring, "Cool FileXfer", 31); conn->xferdata.modtime = 0; conn->xferdata.cretime = 0; - xfer->filename = g_path_get_basename(xfer->local_filename); - conn->xferdata.name_length = MAX(64, strlen(xfer->filename) + 1); - conn->xferdata.name = (guchar *)g_strndup(xfer->filename, conn->xferdata.name_length - 1); + purple_xfer_set_filename(xfer, g_path_get_basename(purple_xfer_get_local_filename(xfer))); + conn->xferdata.name_length = MAX(64, strlen(purple_xfer_get_filename(xfer)) + 1); + conn->xferdata.name = (guchar *)g_strndup(purple_xfer_get_filename(xfer), conn->xferdata.name_length - 1); peer_oft_checksum_file(conn, xfer, peer_oft_checksum_calculated_cb, G_MAXUINT32);