pidgin: 8d57ee58: Rename this enums a little better. And I...

qulogic at pidgin.im qulogic at pidgin.im
Tue May 10 00:16:24 EDT 2011


----------------------------------------------------------------------
Revision: 8d57ee587dfeffcc546fa3ea128a72b0bd137874
Parent:   dcfb8d243dcbbbb6aaa60ac65d28ac944408b4ab
Author:   qulogic at pidgin.im
Date:     05/09/11 23:18:20
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8d57ee587dfeffcc546fa3ea128a72b0bd137874

Changelog: 

Rename this enums a little better. And I don't think we need these
length enums, really.

Changes against parent dcfb8d243dcbbbb6aaa60ac65d28ac944408b4ab

  patched  libpurple/protocols/msn/p2p.c
  patched  libpurple/protocols/msn/p2p.h

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/p2p.h	a791fdfd347b33449912a909167d6fa25412b945
+++ libpurple/protocols/msn/p2p.h	32265080b9d874791020cb6bac2ebeead14b8cb2
@@ -76,17 +76,15 @@ typedef enum
 
 typedef enum
 {
-	P2P_TLV_TYPE_PEER_INFO  = 0x01, /**< Client peer info */
-	P2P_TLV_TYPE_ACK        = 0x02, /**< ACK */
-	P2P_TLV_TYPE_NAK        = 0x03  /**< NAK */
-} P2PTLVType;
+	P2P_HEADER_TLV_TYPE_PEER_INFO  = 0x01, /**< Client peer info */
+	P2P_HEADER_TLV_TYPE_ACK        = 0x02, /**< ACK */
+	P2P_HEADER_TLV_TYPE_NAK        = 0x03  /**< NAK */
+} P2PHeaderTLVType;
 
 typedef enum
 {
-	P2P_TLV_LEN_PEER_INFO   = 12,
-	P2P_TLV_LEN_ACK         = 4,
-	P2P_TLV_LEN_NAK         = 4
-} P2PTLVLength;
+	P2P_DATA_TLV_REMAINING  = 0x01, /**< Indicates the remaining data to transfer.*/
+} P2PDataTLVType;
 
 typedef enum
 {
@@ -97,9 +95,6 @@ typedef enum
 	P2P_PI_CAPS     = 0x0000010f
 } P2PPeerInfoVal;
 
-#define DLP_REMAINING 0x01; 	/**< Indicates the remaining data to transfer.*/
-#define DLP_REMAINING_LEN 8
-
 typedef struct
 {
 	guint32 value;
============================================================
--- libpurple/protocols/msn/p2p.c	817354bed676863f02e1f978390839f2fed67303
+++ libpurple/protocols/msn/p2p.c	7d77097567c39f64788baaec775b9145e16d8d0f
@@ -392,7 +392,7 @@ msn_p2p_info_is_final(MsnP2PInfo *info)
 			break;
 
 		case MSN_P2P_VERSION_TWO:
-			final = msn_tlv_gettlv(info->header.v2.data_tlv, 0x01, 1) == NULL;
+			final = msn_tlv_gettlv(info->header.v2.data_tlv, P2P_DATA_TLV_REMAINING, 1) == NULL;
 			break;
 
 		default:
@@ -422,16 +422,16 @@ msn_p2p_info_create_ack(MsnP2PInfo *old_
 			MsnP2Pv2Header *old = &old_info->header.v2;
 			MsnP2Pv2Header *new = &new_info->header.v2;
 
-			msn_tlvlist_add_32(&new->header_tlv, P2P_TLV_TYPE_ACK, old->base_id + old->message_len);
+			msn_tlvlist_add_32(&new->header_tlv, P2P_HEADER_TLV_TYPE_ACK, old->base_id + old->message_len);
 			new->opcode = P2P_OPCODE_NONE;
 
 			if (old->message_len > 0) {
-				if (!msn_tlv_gettlv(old->header_tlv, P2P_TLV_TYPE_ACK, 1)) {
+				if (!msn_tlv_gettlv(old->header_tlv, P2P_HEADER_TLV_TYPE_ACK, 1)) {
 					if (old->opcode & P2P_OPCODE_SYN) {
 						msn_tlv_t *ack_tlv;
 						new->opcode |= P2P_OPCODE_RAK;
 						
-						ack_tlv = msn_tlv_gettlv(old->header_tlv, P2P_TLV_TYPE_PEER_INFO, 1);
+						ack_tlv = msn_tlv_gettlv(old->header_tlv, P2P_HEADER_TLV_TYPE_PEER_INFO, 1);
 						if (ack_tlv) {
 							msn_tlvlist_add_tlv(&new->header_tlv, ack_tlv);
 							new->opcode |= P2P_OPCODE_SYN;
@@ -484,7 +484,7 @@ msn_p2p_info_is_ack(MsnP2PInfo *info)
 		}
 
 		case MSN_P2P_VERSION_TWO:
-			ret = msn_tlv_gettlv(info->header.v2.header_tlv, P2P_TLV_TYPE_ACK, 1) != NULL;
+			ret = msn_tlv_gettlv(info->header.v2.header_tlv, P2P_HEADER_TLV_TYPE_ACK, 1) != NULL;
 			break;
 
 		default:


More information about the Commits mailing list