pidgin: d09f79ed: Get the P2P version based on the user. S...
qulogic at pidgin.im
qulogic at pidgin.im
Mon May 9 04:21:29 EDT 2011
----------------------------------------------------------------------
Revision: d09f79ede5d30c1f516d4af546eb9a0f1d052593
Parent: 0ffc15c1c059d81c20fbe7cc61c100a52419aa1f
Author: qulogic at pidgin.im
Date: 05/09/11 04:06:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d09f79ede5d30c1f516d4af546eb9a0f1d052593
Changelog:
Get the P2P version based on the user. Still hard-coded as v1 though.
Changes against parent 0ffc15c1c059d81c20fbe7cc61c100a52419aa1f
patched libpurple/protocols/msn/directconn.c
patched libpurple/protocols/msn/msg.c
patched libpurple/protocols/msn/p2p.c
patched libpurple/protocols/msn/p2p.h
patched libpurple/protocols/msn/slpmsg.c
patched libpurple/protocols/msn/slpmsg_part.c
patched libpurple/protocols/msn/slpmsg_part.h
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c 02d2d21c04bfced472657d88424f32c77c08f493
+++ libpurple/protocols/msn/msg.c a86dff02297539c7bc975b356fe6b26468c72abc
@@ -253,8 +253,10 @@ msn_message_parse_payload(MsnMessage *ms
if (content_type != NULL &&
!strcmp(content_type, "application/x-msnmsgrp2p")) {
+ MsnP2PVersion p2p;
msg->msnslp_message = TRUE;
- msg->part = msn_slpmsgpart_new_from_data(tmp, payload_len - (tmp - tmp_base));
+ p2p = msn_p2p_get_user_support(msg->remote_user);
+ msg->part = msn_slpmsgpart_new_from_data(p2p, tmp, payload_len - (tmp - tmp_base));
}
if (payload_len - (tmp - tmp_base) > 0) {
============================================================
--- libpurple/protocols/msn/directconn.c 5857130c322dae73b930e1a4391ee8d5cc031367
+++ libpurple/protocols/msn/directconn.c e606be3e1ce7b0086dbdbf9eea49e737f9c735ab
@@ -593,7 +593,9 @@ msn_dc_process_packet(MsnDirectConn *dc,
case DC_STATE_ESTABLISHED:
if (packet_length) {
- part = msn_slpmsgpart_new_from_data(dc->in_buffer + 4, packet_length);
+ MsnP2PVersion p2p;
+ p2p = msn_p2p_get_user_support(dc->slplink->remote_user);
+ part = msn_slpmsgpart_new_from_data(p2p, dc->in_buffer + 4, packet_length);
if (part) {
msn_slplink_process_msg(dc->slplink, part);
msn_slpmsgpart_unref(part);
============================================================
--- libpurple/protocols/msn/slpmsg.c 6e31cb855dbfec7821c3d97641cceb8dbd2106f2
+++ libpurple/protocols/msn/slpmsg.c 205d2f6942e54428b4285fbb19d28f1e8566d932
@@ -37,6 +37,7 @@ msn_slpmsg_new(MsnSlpLink *slplink, MsnS
msn_slpmsg_new(MsnSlpLink *slplink, MsnSlpCall *slpcall)
{
MsnSlpMessage *slpmsg;
+ MsnP2PVersion p2p;
slpmsg = g_new0(MsnSlpMessage, 1);
@@ -49,7 +50,8 @@ msn_slpmsg_new(MsnSlpLink *slplink, MsnS
slpmsg->slplink = NULL;
slpmsg->slpcall = slpcall;
- slpmsg->p2p_info = msn_p2p_info_new(MSN_P2P_VERSION_ONE);
+ p2p = msn_p2p_get_user_support(slplink->remote_user);
+ slpmsg->p2p_info = msn_p2p_info_new(p2p);
return slpmsg;
}
============================================================
--- libpurple/protocols/msn/p2p.h 328dca8e62d91266353c6b895669171d24c476e2
+++ libpurple/protocols/msn/p2p.h 3c925b7cd8febc4a61145ef87093a730df8f732f
@@ -203,6 +203,9 @@ msn_p2p_info_init_first(MsnP2PInfo *new_
void
msn_p2p_info_init_first(MsnP2PInfo *new_info, MsnP2PInfo *old_info);
+MsnP2PVersion
+msn_p2p_get_user_support(const char *passport);
+
guint32
msn_p2p_info_get_session_id(MsnP2PInfo *info);
============================================================
--- libpurple/protocols/msn/p2p.c b3b5b955c9e79fe0f120c1a5f6ccb627e488d230
+++ libpurple/protocols/msn/p2p.c 9a9d9282d3bc8658eb8bc62db1040da563d5ea1d
@@ -489,6 +489,12 @@ msn_p2p_info_init_first(MsnP2PInfo *info
}
}
+MsnP2PVersion
+msn_p2p_get_user_support(const char *passport)
+{
+ return MSN_P2P_VERSION_ONE;
+}
+
guint32
msn_p2p_info_get_session_id(MsnP2PInfo *info)
{
============================================================
--- libpurple/protocols/msn/slpmsg_part.c bc2993596520f3f4014f0b89e3f17123f2d73736
+++ libpurple/protocols/msn/slpmsg_part.c 46160f06469faee7005d546aaa1b4b411279d9fb
@@ -42,14 +42,15 @@ MsnSlpMessagePart *msn_slpmsgpart_new(Ms
return msn_slpmsgpart_ref(part);
}
-MsnSlpMessagePart *msn_slpmsgpart_new_from_data(const char *data, size_t data_len)
+MsnSlpMessagePart *
+msn_slpmsgpart_new_from_data(MsnP2PVersion p2p, const char *data, size_t data_len)
{
MsnSlpMessagePart *part;
MsnP2PInfo *info;
size_t len;
int body_len;
- info = msn_p2p_info_new(MSN_P2P_VERSION_ONE);
+ info = msn_p2p_info_new(p2p);
/* Extract the binary SLP header */
len = msn_p2p_header_from_wire(info, data, data_len);
============================================================
--- libpurple/protocols/msn/slpmsg_part.h 4c95f40fb5175bcf7544ea60919fba7862a5b539
+++ libpurple/protocols/msn/slpmsg_part.h 6acc3856cd6cbf8f6bea46b7c2032e1f4990b488
@@ -46,7 +46,7 @@ MsnSlpMessagePart *msn_slpmsgpart_new(Ms
MsnSlpMessagePart *msn_slpmsgpart_new(MsnP2PInfo *info);
-MsnSlpMessagePart *msn_slpmsgpart_new_from_data(const char *data, size_t data_len);
+MsnSlpMessagePart *msn_slpmsgpart_new_from_data(MsnP2PVersion p2p, const char *data, size_t data_len);
MsnSlpMessagePart *msn_slpmsgpart_ref(MsnSlpMessagePart *part);
More information about the Commits
mailing list