changeset 30844:7b1b7a4e0bb4

Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.
author masca@cpw.pidgin.im
date Mon, 05 Jul 2010 22:00:10 +0000
parents 98cd0ea847ec
children 6e7a0e87d589
files libpurple/protocols/msn/p2p.h libpurple/protocols/msn/slp.c libpurple/protocols/msn/slpcall.c libpurple/protocols/msn/slpcall.h libpurple/protocols/msn/slplink.c
diffstat 5 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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)
 
--- 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);
--- 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;
--- 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 */
--- 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);
 }