Mercurial > pidgin
diff libpurple/protocols/msn/slpmsg.c @ 30791:64a6ce55aa63
Move more SlpMessage creation to its module.
author | masca@cpw.pidgin.im |
---|---|
date | Sat, 12 Jun 2010 21:22:06 +0000 |
parents | 545fa069c531 |
children | 9192c59f2f84 |
line wrap: on
line diff
--- a/libpurple/protocols/msn/slpmsg.c Thu Jun 10 22:40:44 2010 +0000 +++ b/libpurple/protocols/msn/slpmsg.c Sat Jun 12 21:22:06 2010 +0000 @@ -280,6 +280,48 @@ return slpmsg; } +MsnSlpMessage *msn_slpmsg_new_obj(MsnSlpCall *slpcall,PurpleStoredImage *img) +{ + MsnSlpMessage *slpmsg; + + slpmsg = msn_slpmsg_new(NULL); + slpmsg->slpcall = slpcall; + slpmsg->flags = P2P_MSN_OBJ_DATA; + slpmsg->info = "SLP DATA"; + + msn_slpmsg_set_image(slpmsg, img); + + return slpmsg; +} + +MsnSlpMessage *msn_slpmsg_new_dataprep(MsnSlpCall *slpcall) +{ + MsnSlpMessage *slpmsg; + + slpmsg = msn_slpmsg_new(NULL); + slpmsg->slpcall = slpcall; + slpmsg->session_id = slpcall->session_id; + msn_slpmsg_set_body(slpmsg, NULL, 4); + slpmsg->info = "SLP DATA PREP"; + + return slpmsg; + +} + +MsnSlpMessage *msn_slpmsg_new_file(MsnSlpCall *slpcall, size_t size) +{ + MsnSlpMessage *slpmsg; + + slpmsg = msn_slpmsg_new(NULL); + + slpmsg->slpcall = slpcall; + slpmsg->flags = P2P_FILE_DATA; + slpmsg->info = "SLP FILE"; + slpmsg->size = size; + + return slpmsg; +} + char *msn_slpmsg_serialize(MsnSlpMessage *slpmsg, size_t *ret_size) { MsnP2PHeader *header;