Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/peer_proxy.c @ 25416:6e1967b0f90b
Change "screen name" to "username" or "buddy name" in a whole bunch of
places in the code. I've been using the definitions from the jabber
specs, where "user" is me and "buddy" is someone on my buddy list.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 26 Jan 2009 09:12:04 +0000 |
parents | 8f353a311895 |
children | bbb27d65681f |
comparison
equal
deleted
inserted
replaced
25415:584063555949 | 25416:6e1967b0f90b |
---|---|
61 static void | 61 static void |
62 peer_proxy_send_create_new_conn(PeerConnection *conn) | 62 peer_proxy_send_create_new_conn(PeerConnection *conn) |
63 { | 63 { |
64 ProxyFrame frame; | 64 ProxyFrame frame; |
65 PurpleAccount *account; | 65 PurpleAccount *account; |
66 const gchar *sn; | 66 const gchar *bn; |
67 guint8 sn_length; | 67 guint8 bn_length; |
68 | 68 |
69 memset(&frame, 0, sizeof(ProxyFrame)); | 69 memset(&frame, 0, sizeof(ProxyFrame)); |
70 frame.type = PEER_PROXY_TYPE_CREATE; | 70 frame.type = PEER_PROXY_TYPE_CREATE; |
71 frame.flags = 0x0000; | 71 frame.flags = 0x0000; |
72 | 72 |
73 account = purple_connection_get_account(conn->od->gc); | 73 account = purple_connection_get_account(conn->od->gc); |
74 sn = purple_account_get_username(account); | 74 bn = purple_account_get_username(account); |
75 sn_length = strlen(sn); | 75 bn_length = strlen(bn); |
76 byte_stream_new(&frame.payload, 1 + sn_length + 8 + 20); | 76 byte_stream_new(&frame.payload, 1 + bn_length + 8 + 20); |
77 byte_stream_put8(&frame.payload, sn_length); | 77 byte_stream_put8(&frame.payload, bn_length); |
78 byte_stream_putraw(&frame.payload, (const guint8 *)sn, sn_length); | 78 byte_stream_putraw(&frame.payload, (const guint8 *)bn, bn_length); |
79 byte_stream_putraw(&frame.payload, conn->cookie, 8); | 79 byte_stream_putraw(&frame.payload, conn->cookie, 8); |
80 | 80 |
81 byte_stream_put16(&frame.payload, 0x0001); /* Type */ | 81 byte_stream_put16(&frame.payload, 0x0001); /* Type */ |
82 byte_stream_put16(&frame.payload, 16); /* Length */ | 82 byte_stream_put16(&frame.payload, 16); /* Length */ |
83 byte_stream_putcaps(&frame.payload, conn->type); /* Value */ | 83 byte_stream_putcaps(&frame.payload, conn->type); /* Value */ |
97 static void | 97 static void |
98 peer_proxy_send_join_existing_conn(PeerConnection *conn, guint16 pin) | 98 peer_proxy_send_join_existing_conn(PeerConnection *conn, guint16 pin) |
99 { | 99 { |
100 ProxyFrame frame; | 100 ProxyFrame frame; |
101 PurpleAccount *account; | 101 PurpleAccount *account; |
102 const gchar *sn; | 102 const gchar *bn; |
103 guint8 sn_length; | 103 guint8 bn_length; |
104 | 104 |
105 memset(&frame, 0, sizeof(ProxyFrame)); | 105 memset(&frame, 0, sizeof(ProxyFrame)); |
106 frame.type = PEER_PROXY_TYPE_JOIN; | 106 frame.type = PEER_PROXY_TYPE_JOIN; |
107 frame.flags = 0x0000; | 107 frame.flags = 0x0000; |
108 | 108 |
109 account = purple_connection_get_account(conn->od->gc); | 109 account = purple_connection_get_account(conn->od->gc); |
110 sn = purple_account_get_username(account); | 110 bn = purple_account_get_username(account); |
111 sn_length = strlen(sn); | 111 bn_length = strlen(bn); |
112 byte_stream_new(&frame.payload, 1 + sn_length + 2 + 8 + 20); | 112 byte_stream_new(&frame.payload, 1 + bn_length + 2 + 8 + 20); |
113 byte_stream_put8(&frame.payload, sn_length); | 113 byte_stream_put8(&frame.payload, bn_length); |
114 byte_stream_putraw(&frame.payload, (const guint8 *)sn, sn_length); | 114 byte_stream_putraw(&frame.payload, (const guint8 *)bn, bn_length); |
115 byte_stream_put16(&frame.payload, pin); | 115 byte_stream_put16(&frame.payload, pin); |
116 byte_stream_putraw(&frame.payload, conn->cookie, 8); | 116 byte_stream_putraw(&frame.payload, conn->cookie, 8); |
117 | 117 |
118 byte_stream_put16(&frame.payload, 0x0001); /* Type */ | 118 byte_stream_put16(&frame.payload, 0x0001); /* Type */ |
119 byte_stream_put16(&frame.payload, 16); /* Length */ | 119 byte_stream_put16(&frame.payload, 16); /* Length */ |
147 for (i = 0; i < 4; i++) | 147 for (i = 0; i < 4; i++) |
148 ip[i] = byte_stream_get8(&frame->payload); | 148 ip[i] = byte_stream_get8(&frame->payload); |
149 if (conn->type == OSCAR_CAPABILITY_DIRECTIM) | 149 if (conn->type == OSCAR_CAPABILITY_DIRECTIM) |
150 aim_im_sendch2_odc_requestproxy(conn->od, | 150 aim_im_sendch2_odc_requestproxy(conn->od, |
151 conn->cookie, | 151 conn->cookie, |
152 conn->sn, ip, pin, ++conn->lastrequestnumber); | 152 conn->bn, ip, pin, ++conn->lastrequestnumber); |
153 else if (conn->type == OSCAR_CAPABILITY_SENDFILE) | 153 else if (conn->type == OSCAR_CAPABILITY_SENDFILE) |
154 { | 154 { |
155 aim_im_sendch2_sendfile_requestproxy(conn->od, | 155 aim_im_sendch2_sendfile_requestproxy(conn->od, |
156 conn->cookie, conn->sn, | 156 conn->cookie, conn->bn, |
157 ip, pin, ++conn->lastrequestnumber, | 157 ip, pin, ++conn->lastrequestnumber, |
158 (const gchar *)conn->xferdata.name, | 158 (const gchar *)conn->xferdata.name, |
159 conn->xferdata.size, conn->xferdata.totfiles); | 159 conn->xferdata.size, conn->xferdata.totfiles); |
160 } | 160 } |
161 } | 161 } |