diff libpurple/protocols/jabber/oob.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 ac88c8fc3f47
children e164f7815b52
line wrap: on
line diff
--- a/libpurple/protocols/jabber/oob.c	Mon Aug 29 22:50:03 2011 +0000
+++ b/libpurple/protocols/jabber/oob.c	Mon Aug 29 22:55:51 2011 +0000
@@ -76,7 +76,7 @@
 	JabberIq *iq;
 
 	iq = jabber_iq_new(jox->js, JABBER_IQ_RESULT);
-	xmlnode_set_attrib(iq->node, "to", xfer->who);
+	xmlnode_set_attrib(iq->node, "to", purple_xfer_get_remote_user(xfer));
 	jabber_iq_set_id(iq, jox->iq_id);
 
 	jabber_iq_send(iq);
@@ -89,7 +89,7 @@
 	JabberOOBXfer *jox = purple_xfer_get_protocol_data(xfer);
 	int len, total_len = strlen(jox->write_buffer);
 
-	len = write(xfer->fd, jox->write_buffer + jox->written_len,
+	len = purple_xfer_write(xfer, (guchar*) jox->write_buffer + jox->written_len,
 		total_len - jox->written_len);
 
 	if(len < 0 && errno == EAGAIN)
@@ -163,7 +163,7 @@
 	xmlnode *y, *z;
 
 	iq = jabber_iq_new(jox->js, JABBER_IQ_ERROR);
-	xmlnode_set_attrib(iq->node, "to", xfer->who);
+	xmlnode_set_attrib(iq->node, "to", purple_xfer_get_remote_user(xfer));
 	jabber_iq_set_id(iq, jox->iq_id);
 	y = xmlnode_new_child(iq->node, "error");
 	xmlnode_set_attrib(y, "code", code);