Mercurial > pidgin
comparison src/protocols/oscar/family_locate.c @ 13253:87a7c3077c19
[gaim-migrate @ 15619]
More cleaning up of oscar. Renamed some functions to be more clear.
Got rid of some stuff that wasn't used. Inlined some small things
in conn.c that were only used once.
The goals of all this are
1. Non-blocking I/O for all connections
2. p2p stuff won't use the same struct as oscar connections, because
that's stupid
3. The oscar PRPL should be less scary
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 12 Feb 2006 21:27:04 +0000 |
parents | f260d319bbbc |
children | 6519aeb66b31 |
comparison
equal
deleted
inserted
replaced
13252:2871c385c45a | 13253:87a7c3077c19 |
---|---|
1070 free(encoding); | 1070 free(encoding); |
1071 } else | 1071 } else |
1072 aim_tlvlist_add_noval(&tl, 0x0004); | 1072 aim_tlvlist_add_noval(&tl, 0x0004); |
1073 } | 1073 } |
1074 | 1074 |
1075 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + aim_tlvlist_size(&tl)))) | 1075 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + aim_tlvlist_size(&tl)))) |
1076 return -ENOMEM; | 1076 return -ENOMEM; |
1077 | 1077 |
1078 snacid = aim_cachesnac(sess, 0x0002, 0x0004, 0x0000, NULL, 0); | 1078 snacid = aim_cachesnac(sess, 0x0002, 0x0004, 0x0000, NULL, 0); |
1079 aim_putsnac(&fr->data, 0x0002, 0x004, 0x0000, snacid); | 1079 aim_putsnac(&fr->data, 0x0002, 0x004, 0x0000, snacid); |
1080 | 1080 |
1099 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE))) | 1099 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE))) |
1100 return -EINVAL; | 1100 return -EINVAL; |
1101 | 1101 |
1102 aim_tlvlist_add_caps(&tl, 0x0005, caps); | 1102 aim_tlvlist_add_caps(&tl, 0x0005, caps); |
1103 | 1103 |
1104 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + aim_tlvlist_size(&tl)))) | 1104 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + aim_tlvlist_size(&tl)))) |
1105 return -ENOMEM; | 1105 return -ENOMEM; |
1106 | 1106 |
1107 snacid = aim_cachesnac(sess, 0x0002, 0x0004, 0x0000, NULL, 0); | 1107 snacid = aim_cachesnac(sess, 0x0002, 0x0004, 0x0000, NULL, 0); |
1108 aim_putsnac(&fr->data, 0x0002, 0x004, 0x0000, snacid); | 1108 aim_putsnac(&fr->data, 0x0002, 0x004, 0x0000, snacid); |
1109 | 1109 |
1131 aim_snacid_t snacid; | 1131 aim_snacid_t snacid; |
1132 | 1132 |
1133 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) | 1133 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) |
1134 return -EINVAL; | 1134 return -EINVAL; |
1135 | 1135 |
1136 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 12+1+strlen(sn)))) | 1136 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 12+1+strlen(sn)))) |
1137 return -ENOMEM; | 1137 return -ENOMEM; |
1138 | 1138 |
1139 snacid = aim_cachesnac(sess, 0x0002, 0x0005, 0x0000, NULL, 0); | 1139 snacid = aim_cachesnac(sess, 0x0002, 0x0005, 0x0000, NULL, 0); |
1140 | 1140 |
1141 aim_putsnac(&fr->data, 0x0002, 0x0005, 0x0000, snacid); | 1141 aim_putsnac(&fr->data, 0x0002, 0x0005, 0x0000, snacid); |
1244 aim_tlvlist_add_str(&tl, 0x000d, zip); | 1244 aim_tlvlist_add_str(&tl, 0x000d, zip); |
1245 | 1245 |
1246 if (street) | 1246 if (street) |
1247 aim_tlvlist_add_str(&tl, 0x0021, street); | 1247 aim_tlvlist_add_str(&tl, 0x0021, street); |
1248 | 1248 |
1249 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) | 1249 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) |
1250 return -ENOMEM; | 1250 return -ENOMEM; |
1251 | 1251 |
1252 snacid = aim_cachesnac(sess, 0x0002, 0x0009, 0x0000, NULL, 0); | 1252 snacid = aim_cachesnac(sess, 0x0002, 0x0009, 0x0000, NULL, 0); |
1253 | 1253 |
1254 aim_putsnac(&fr->data, 0x0002, 0x0009, 0x0000, snacid); | 1254 aim_putsnac(&fr->data, 0x0002, 0x0009, 0x0000, snacid); |
1272 return -EINVAL; | 1272 return -EINVAL; |
1273 | 1273 |
1274 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) | 1274 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) |
1275 return -EINVAL; | 1275 return -EINVAL; |
1276 | 1276 |
1277 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) | 1277 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+1+strlen(sn)))) |
1278 return -ENOMEM; | 1278 return -ENOMEM; |
1279 | 1279 |
1280 snacid = aim_cachesnac(sess, 0x0002, 0x000b, 0x0000, NULL, 0); | 1280 snacid = aim_cachesnac(sess, 0x0002, 0x000b, 0x0000, NULL, 0); |
1281 | 1281 |
1282 aim_putsnac(&fr->data, 0x0002, 0x000b, 0x0000, snacid); | 1282 aim_putsnac(&fr->data, 0x0002, 0x000b, 0x0000, snacid); |
1316 if (interest4) | 1316 if (interest4) |
1317 aim_tlvlist_add_str(&tl, 0x0000b, interest4); | 1317 aim_tlvlist_add_str(&tl, 0x0000b, interest4); |
1318 if (interest5) | 1318 if (interest5) |
1319 aim_tlvlist_add_str(&tl, 0x0000b, interest5); | 1319 aim_tlvlist_add_str(&tl, 0x0000b, interest5); |
1320 | 1320 |
1321 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) | 1321 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+aim_tlvlist_size(&tl)))) |
1322 return -ENOMEM; | 1322 return -ENOMEM; |
1323 | 1323 |
1324 snacid = aim_cachesnac(sess, 0x0002, 0x000f, 0x0000, NULL, 0); | 1324 snacid = aim_cachesnac(sess, 0x0002, 0x000f, 0x0000, NULL, 0); |
1325 | 1325 |
1326 aim_putsnac(&fr->data, 0x0002, 0x000f, 0x0000, 0); | 1326 aim_putsnac(&fr->data, 0x0002, 0x000f, 0x0000, 0); |
1351 aim_snacid_t snacid; | 1351 aim_snacid_t snacid; |
1352 | 1352 |
1353 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) | 1353 if (!sess || !(conn = aim_conn_findbygroup(sess, OSCAR_FAMILY_LOCATE)) || !sn) |
1354 return -EINVAL; | 1354 return -EINVAL; |
1355 | 1355 |
1356 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4+1+strlen(sn)))) | 1356 if (!(fr = flap_frame_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+4+1+strlen(sn)))) |
1357 return -ENOMEM; | 1357 return -ENOMEM; |
1358 | 1358 |
1359 snacid = aim_cachesnac(sess, 0x0002, 0x0015, 0x0000, sn, strlen(sn)+1); | 1359 snacid = aim_cachesnac(sess, 0x0002, 0x0015, 0x0000, sn, strlen(sn)+1); |
1360 | 1360 |
1361 aim_putsnac(&fr->data, 0x0002, 0x0015, 0x0000, snacid); | 1361 aim_putsnac(&fr->data, 0x0002, 0x0015, 0x0000, snacid); |