Mercurial > pidgin
annotate libfaim/aim_buddylist.c @ 722:26e96119d5a5
[gaim-migrate @ 732]
more libfaim changes
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 18 Aug 2000 20:13:41 +0000 |
parents | 58106806ac2b |
children | 88f8f98de02d |
rev | line source |
---|---|
2 | 1 |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
2 #include <faim/aim.h> |
2 | 3 |
4 /* | |
5 * aim_add_buddy() | |
6 * | |
7 * Adds a single buddy to your buddy list after login. | |
8 * | |
9 */ | |
237 | 10 u_long aim_add_buddy(struct aim_session_t *sess, |
11 struct aim_conn_t *conn, | |
12 char *sn ) | |
2 | 13 { |
237 | 14 struct command_tx_struct *newpacket; |
15 int i; | |
2 | 16 |
237 | 17 if(!sn) |
18 return -1; | |
2 | 19 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
20 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+1+strlen(sn)))) |
237 | 21 return -1; |
22 | |
23 newpacket->lock = 1; | |
2 | 24 |
237 | 25 i = aim_putsnac(newpacket->data, 0x0003, 0x0004, 0x0000, sess->snac_nextid); |
26 i += aimutil_put8(newpacket->data+i, strlen(sn)); | |
27 i += aimutil_putstr(newpacket->data+i, sn, strlen(sn)); | |
2 | 28 |
237 | 29 aim_tx_enqueue(sess, newpacket ); |
2 | 30 |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
31 #if 0 /* do we really need this code? */ |
2 | 32 { |
33 struct aim_snac_t snac; | |
34 | |
237 | 35 snac.id = sess->snac_nextid; |
2 | 36 snac.family = 0x0003; |
37 snac.type = 0x0004; | |
38 snac.flags = 0x0000; | |
39 | |
40 snac.data = malloc( strlen( sn ) + 1 ); | |
41 memcpy( snac.data, sn, strlen( sn ) + 1 ); | |
42 | |
237 | 43 aim_newsnac(sess, &snac); |
2 | 44 } |
715
58106806ac2b
[gaim-migrate @ 725]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
45 #endif |
2 | 46 |
237 | 47 return( sess->snac_nextid++ ); |
2 | 48 } |
49 | |
237 | 50 u_long aim_remove_buddy(struct aim_session_t *sess, |
51 struct aim_conn_t *conn, | |
52 char *sn ) | |
2 | 53 { |
237 | 54 struct command_tx_struct *newpacket; |
55 int i; | |
2 | 56 |
237 | 57 if(!sn) |
58 return -1; | |
2 | 59 |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
60 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+1+strlen(sn)))) |
237 | 61 return -1; |
62 | |
63 newpacket->lock = 1; | |
2 | 64 |
237 | 65 i = aim_putsnac(newpacket->data, 0x0003, 0x0005, 0x0000, sess->snac_nextid); |
2 | 66 |
237 | 67 i += aimutil_put8(newpacket->data+i, strlen(sn)); |
68 i += aimutil_putstr(newpacket->data+i, sn, strlen(sn)); | |
2 | 69 |
237 | 70 aim_tx_enqueue(sess, newpacket); |
2 | 71 |
72 { | |
73 struct aim_snac_t snac; | |
74 | |
237 | 75 snac.id = sess->snac_nextid; |
2 | 76 snac.family = 0x0003; |
77 snac.type = 0x0005; | |
78 snac.flags = 0x0000; | |
79 | |
80 snac.data = malloc( strlen( sn ) + 1 ); | |
81 memcpy( snac.data, sn, strlen( sn ) + 1 ); | |
82 | |
237 | 83 aim_newsnac(sess, &snac ); |
2 | 84 } |
85 | |
237 | 86 return( sess->snac_nextid++ ); |
2 | 87 } |
88 |