Changes in protocols/oscar/buddylist.c [6042a54:b7d3cc34]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/buddylist.c
r6042a54 rb7d3cc34 91 91 return 0; 92 92 } 93 94 /* 95 * aim_add_buddy() 96 * 97 * Adds a single buddy to your buddy list after login. 98 * 99 * XXX this should just be an extension of setbuddylist() 100 * 101 */ 102 int aim_add_buddy(aim_session_t *sess, aim_conn_t *conn, const char *sn) 103 { 104 aim_frame_t *fr; 105 aim_snacid_t snacid; 106 107 if (!sn || !strlen(sn)) 108 return -EINVAL; 109 110 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) 111 return -ENOMEM; 112 113 snacid = aim_cachesnac(sess, 0x0003, 0x0004, 0x0000, sn, strlen(sn)+1); 114 aim_putsnac(&fr->data, 0x0003, 0x0004, 0x0000, snacid); 115 116 aimbs_put8(&fr->data, strlen(sn)); 117 aimbs_putraw(&fr->data, (guint8 *)sn, strlen(sn)); 118 119 aim_tx_enqueue(sess, fr); 120 121 return 0; 122 } 123 124 /* 125 * XXX generalise to support removing multiple buddies (basically, its 126 * the same as setbuddylist() but with a different snac subtype). 127 * 128 */ 129 int aim_remove_buddy(aim_session_t *sess, aim_conn_t *conn, const char *sn) 130 { 131 aim_frame_t *fr; 132 aim_snacid_t snacid; 133 134 if (!sn || !strlen(sn)) 135 return -EINVAL; 136 137 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) 138 return -ENOMEM; 139 140 snacid = aim_cachesnac(sess, 0x0003, 0x0005, 0x0000, sn, strlen(sn)+1); 141 aim_putsnac(&fr->data, 0x0003, 0x0005, 0x0000, snacid); 142 143 aimbs_put8(&fr->data, strlen(sn)); 144 aimbs_putraw(&fr->data, (guint8 *)sn, strlen(sn)); 145 146 aim_tx_enqueue(sess, fr); 147 148 return 0; 149 } 150
Note: See TracChangeset
for help on using the changeset viewer.