soc.2010.msn-tlc: aa418686: Documetn P2P Application ID in a enum an...

masca at cpw.pidgin.im masca at cpw.pidgin.im
Mon Jul 5 23:01:29 EDT 2010


----------------------------------------------------------------------
Revision: aa41868663429716c31b407a0cc52e73c7fd2a65
Parent:   1576188c57f7d718bb6c7602aff243b69713b17d
Author:   masca at cpw.pidgin.im
Date:     07/05/10 18:00:10
Branch:   im.pidgin.soc.2010.msn-tlc
URL: http://d.pidgin.im/viewmtn/revision/info/aa41868663429716c31b407a0cc52e73c7fd2a65

Changelog: 

Documetn P2P Application ID in a enum and use it instead of 'magic numbers'.

Changes against parent 1576188c57f7d718bb6c7602aff243b69713b17d

  patched  libpurple/protocols/msn/p2p.h
  patched  libpurple/protocols/msn/slp.c
  patched  libpurple/protocols/msn/slpcall.c
  patched  libpurple/protocols/msn/slpcall.h
  patched  libpurple/protocols/msn/slplink.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/slp.c	bca03f1d4706f64166549c213fa7fa1504c33580
+++ libpurple/protocols/msn/slp.c	a6b18c7a07a3bab92b51173919cb4693c58ae9f2
@@ -360,7 +360,7 @@ msn_request_ft(PurpleXfer *xfer)
 
 	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);
============================================================
--- libpurple/protocols/msn/slpcall.c	c724943e775091ed5c9fc361335e6f7ffcc76af8
+++ libpurple/protocols/msn/slpcall.c	3511348a10e4d69ef7f0e42ee6b1d7092a533a5d
@@ -146,7 +146,7 @@ msn_slpcall_invite(MsnSlpCall *slpcall, 
 
 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;
============================================================
--- libpurple/protocols/msn/slpcall.h	8a18542407dace9d273b0be50dad7982e147c434
+++ libpurple/protocols/msn/slpcall.h	4b60f24627c058623286be0dd0e6bba479eda67d
@@ -92,7 +92,7 @@ void msn_slpcall_invite(MsnSlpCall *slpc
 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 */
============================================================
--- libpurple/protocols/msn/slplink.c	d9f30cb761628da895fb781cb1cb4d705d9c2a11
+++ libpurple/protocols/msn/slplink.c	71031668e2d795cc079f22357475ef022c9ec9fc
@@ -656,7 +656,7 @@ msn_slplink_request_object(MsnSlpLink *s
 	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);
 }
============================================================
--- libpurple/protocols/msn/p2p.h	c0ad708ddb194674f7427be6eba914f70b1cd967
+++ libpurple/protocols/msn/p2p.h	acf1f130235cd3a764c2719e691987092334d389
@@ -52,6 +52,15 @@ typedef enum
  * #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)
 


More information about the Commits mailing list