pidgin: d949803a: Getting the P2P version is probably the ...
qulogic at pidgin.im
qulogic at pidgin.im
Tue May 10 00:16:26 EDT 2011
----------------------------------------------------------------------
Revision: d949803a9ceebd4012c772fbba53c34e7e28fb2f
Parent: d78cffbef133c407226e5feaf504707ea451a3af
Author: qulogic at pidgin.im
Date: 05/09/11 18:56:29
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d949803a9ceebd4012c772fbba53c34e7e28fb2f
Changelog:
Getting the P2P version is probably the slplink's job, since it has
the rest of the information we need, like the session, which gives us
the userlist, etc.
Changes against parent d78cffbef133c407226e5feaf504707ea451a3af
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/slplink.c
patched libpurple/protocols/msn/slplink.h
patched libpurple/protocols/msn/slpmsg.c
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msg.c bffee978b412fada3f1ba0b68b32115fc895f9f6
+++ libpurple/protocols/msn/msg.c 94fe3963ccab9a56f0311277c241efbc0242a4d6
@@ -864,7 +864,7 @@ msn_p2p_msg(MsnCmdProc *cmdproc, MsnMess
}
}
- p2p = msn_p2p_get_user_support(msg->remote_user);
+ p2p = msn_slplink_get_p2p_version(slplink);
msg->part = msn_slpmsgpart_new_from_data(p2p, msg->body, msg->body_len);
if (msg->part)
============================================================
--- libpurple/protocols/msn/directconn.c e606be3e1ce7b0086dbdbf9eea49e737f9c735ab
+++ libpurple/protocols/msn/directconn.c 2f273f936b3288794e4634cf0471488f9a296856
@@ -594,7 +594,7 @@ msn_dc_process_packet(MsnDirectConn *dc,
case DC_STATE_ESTABLISHED:
if (packet_length) {
MsnP2PVersion p2p;
- p2p = msn_p2p_get_user_support(dc->slplink->remote_user);
+ p2p = msn_slplink_get_p2p_version(dc->slplink);
part = msn_slpmsgpart_new_from_data(p2p, dc->in_buffer + 4, packet_length);
if (part) {
msn_slplink_process_msg(dc->slplink, part);
============================================================
--- libpurple/protocols/msn/slplink.c 97549973787364cff04f0fc8d7dfe10c51dc53c8
+++ libpurple/protocols/msn/slplink.c d0f752cce6ae97b6a3f5ae2b51fa6d878f039af3
@@ -79,6 +79,7 @@ msn_slplink_new(MsnSession *session, con
slplink->slp_seq_id = rand() % 0xFFFFFF00 + 4;
slplink->remote_user = g_strdup(username);
+ slplink->p2p_version = MSN_P2P_VERSION_ONE;
slplink->slp_msg_queue = g_queue_new();
@@ -264,6 +265,12 @@ msn_slplink_find_slp_call_with_session_i
return NULL;
}
+MsnP2PVersion
+msn_slplink_get_p2p_version(MsnSlpLink *slplink)
+{
+ return slplink->p2p_version;
+}
+
static void
msn_slplink_send_part(MsnSlpLink *slplink, MsnSlpMessagePart *part)
{
============================================================
--- libpurple/protocols/msn/slplink.h 0a3f561f407f4b9503d352ba5be546fc82da72d1
+++ libpurple/protocols/msn/slplink.h 91cba756fc48cb2fab9ebe9abaf2c0a1b28e255b
@@ -45,6 +45,7 @@ struct _MsnSlpLink
guint refs;
char *remote_user;
+ MsnP2PVersion p2p_version;
int slp_seq_id;
@@ -75,6 +76,8 @@ MsnSlpCall *msn_slplink_find_slp_call_wi
MsnSlpCall *msn_slplink_find_slp_call(MsnSlpLink *slplink,
const char *id);
MsnSlpCall *msn_slplink_find_slp_call_with_session_id(MsnSlpLink *slplink, long id);
+MsnP2PVersion msn_slplink_get_p2p_version(MsnSlpLink *slplink);
+
void msn_slplink_queue_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
void msn_slplink_send_slpmsg(MsnSlpLink *slplink,
MsnSlpMessage *slpmsg);
============================================================
--- libpurple/protocols/msn/slpmsg.c 6878c0746f1b0ceb186c1bc1635bda3a68f79c17
+++ libpurple/protocols/msn/slpmsg.c 0698820d787f33ab443f6e6134b08f9b346f9b3f
@@ -49,7 +49,7 @@ msn_slpmsg_new(MsnSlpLink *slplink, MsnS
msn_slpmsg_set_slplink(slpmsg, slplink);
slpmsg->slpcall = slpcall;
- p2p = msn_p2p_get_user_support(slplink->remote_user);
+ p2p = msn_slplink_get_p2p_version(slplink);
slpmsg->p2p_info = msn_p2p_info_new(p2p);
return slpmsg;
============================================================
--- libpurple/protocols/msn/p2p.h 3c925b7cd8febc4a61145ef87093a730df8f732f
+++ libpurple/protocols/msn/p2p.h 328dca8e62d91266353c6b895669171d24c476e2
@@ -203,9 +203,6 @@ 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 9a9d9282d3bc8658eb8bc62db1040da563d5ea1d
+++ libpurple/protocols/msn/p2p.c b3b5b955c9e79fe0f120c1a5f6ccb627e488d230
@@ -489,12 +489,6 @@ 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)
{
More information about the Commits
mailing list