# HG changeset patch # User masca@cpw.pidgin.im # Date 1278367210 0 # Node ID 7b1b7a4e0bb493da0063519db0b978eec871691a # Parent 98cd0ea847ec6a24227dd8ce7eb978fdcea48923 Documetn P2P Application ID in a enum and use it instead of 'magic numbers'. diff -r 98cd0ea847ec -r 7b1b7a4e0bb4 libpurple/protocols/msn/p2p.h --- a/libpurple/protocols/msn/p2p.h Mon Jul 05 21:35:46 2010 +0000 +++ b/libpurple/protocols/msn/p2p.h Mon Jul 05 22:00:10 2010 +0000 @@ -52,6 +52,15 @@ * #7180 */ +typedef enum +{ + P2P_APPID_SESION = 0x0, /**< Negotiating session */ + P2P_APPID_OBJ = 0x1, /**< MsnObject (Display or Emoticon) */ + P2P_APPID_FILE = 0x2, /**< File transfer */ + P2P_APPID_EMOTE = 0xB, /**< CustomEmoticon */ + P2P_APPID_DISPLAY = 0xC /**< Display Image */ +} MsnP2PAppId; + #define P2P_PACKET_HEADER_SIZE sizeof(MsnP2PHeader) #define P2P_PACKET_FOOTER_SIZE sizeof(MsnP2PFooter) diff -r 98cd0ea847ec -r 7b1b7a4e0bb4 libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Mon Jul 05 21:35:46 2010 +0000 +++ b/libpurple/protocols/msn/slp.c Mon Jul 05 22:00:10 2010 +0000 @@ -360,7 +360,7 @@ context = gen_context(xfer, fn, fp); - msn_slpcall_invite(slpcall, MSN_FT_GUID, 2, context); + msn_slpcall_invite(slpcall, MSN_FT_GUID, P2P_APPID_FILE, context); msn_slplink_unref(slplink); g_free(context); diff -r 98cd0ea847ec -r 7b1b7a4e0bb4 libpurple/protocols/msn/slpcall.c --- a/libpurple/protocols/msn/slpcall.c Mon Jul 05 21:35:46 2010 +0000 +++ b/libpurple/protocols/msn/slpcall.c Mon Jul 05 22:00:10 2010 +0000 @@ -146,7 +146,7 @@ void msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, - int app_id, const char *context) + MsnP2PAppId app_id, const char *context) { MsnSlpLink *slplink; MsnSlpMessage *slpmsg; diff -r 98cd0ea847ec -r 7b1b7a4e0bb4 libpurple/protocols/msn/slpcall.h --- a/libpurple/protocols/msn/slpcall.h Mon Jul 05 21:35:46 2010 +0000 +++ b/libpurple/protocols/msn/slpcall.h Mon Jul 05 22:00:10 2010 +0000 @@ -92,7 +92,7 @@ void msn_slpcall_session_init(MsnSlpCall *slpcall); void msn_slpcall_destroy(MsnSlpCall *slpcall); void msn_slpcall_invite(MsnSlpCall *slpcall, const char *euf_guid, - int app_id, const char *context); + MsnP2PAppId app_id, const char *context); void msn_slpcall_close(MsnSlpCall *slpcall); #endif /* MSN_SLPCALL_H */ diff -r 98cd0ea847ec -r 7b1b7a4e0bb4 libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Mon Jul 05 21:35:46 2010 +0000 +++ b/libpurple/protocols/msn/slplink.c Mon Jul 05 22:00:10 2010 +0000 @@ -656,7 +656,7 @@ slpcall->cb = cb; slpcall->end_cb = end_cb; - msn_slpcall_invite(slpcall, MSN_OBJ_GUID, 1, msnobj_base64); + msn_slpcall_invite(slpcall, MSN_OBJ_GUID, P2P_APPID_OBJ, msnobj_base64); g_free(msnobj_base64); }