Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_bart.c @ 23315:9c0ee2491ed1
Replaced family_*'s magic numbers of FLAP families with the constants
defined in snactypes.h
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Sat, 07 Jun 2008 18:42:48 +0000 |
parents | ab2322195dab |
children | 6e1967b0f90b |
comparison
equal
deleted
inserted
replaced
23314:afdbbf36499e | 23315:9c0ee2491ed1 |
---|---|
41 { | 41 { |
42 FlapConnection *conn; | 42 FlapConnection *conn; |
43 ByteStream bs; | 43 ByteStream bs; |
44 aim_snacid_t snacid; | 44 aim_snacid_t snacid; |
45 | 45 |
46 if (!od || !(conn = flap_connection_findbygroup(od, 0x0010)) || !icon || !iconlen) | 46 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BART)) || !icon || !iconlen) |
47 return -EINVAL; | 47 return -EINVAL; |
48 | 48 |
49 byte_stream_new(&bs, 2 + 2 + iconlen); | 49 byte_stream_new(&bs, 2 + 2 + iconlen); |
50 | 50 |
51 /* The reference number for the icon */ | 51 /* The reference number for the icon */ |
53 | 53 |
54 /* The icon */ | 54 /* The icon */ |
55 byte_stream_put16(&bs, iconlen); | 55 byte_stream_put16(&bs, iconlen); |
56 byte_stream_putraw(&bs, icon, iconlen); | 56 byte_stream_putraw(&bs, icon, iconlen); |
57 | 57 |
58 snacid = aim_cachesnac(od, 0x0010, 0x0002, 0x0000, NULL, 0); | 58 snacid = aim_cachesnac(od, SNAC_FAMILY_BART, 0x0002, 0x0000, NULL, 0); |
59 flap_connection_send_snac(od, conn, 0x0010, 0x0002, 0x0000, snacid, &bs); | 59 flap_connection_send_snac(od, conn, SNAC_FAMILY_BART, 0x0002, 0x0000, snacid, &bs); |
60 | 60 |
61 byte_stream_destroy(&bs); | 61 byte_stream_destroy(&bs); |
62 | 62 |
63 return 0; | 63 return 0; |
64 } | 64 } |
100 { | 100 { |
101 FlapConnection *conn; | 101 FlapConnection *conn; |
102 ByteStream bs; | 102 ByteStream bs; |
103 aim_snacid_t snacid; | 103 aim_snacid_t snacid; |
104 | 104 |
105 if (!od || !(conn = flap_connection_findbygroup(od, 0x0010)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen) | 105 if (!od || !(conn = flap_connection_findbygroup(od, SNAC_FAMILY_BART)) || !sn || !strlen(sn) || !iconcsum || !iconcsumlen) |
106 return -EINVAL; | 106 return -EINVAL; |
107 | 107 |
108 byte_stream_new(&bs, 1+strlen(sn) + 4 + 1+iconcsumlen); | 108 byte_stream_new(&bs, 1+strlen(sn) + 4 + 1+iconcsumlen); |
109 | 109 |
110 /* Screen name */ | 110 /* Screen name */ |
118 | 118 |
119 /* Icon string */ | 119 /* Icon string */ |
120 byte_stream_put8(&bs, iconcsumlen); | 120 byte_stream_put8(&bs, iconcsumlen); |
121 byte_stream_putraw(&bs, iconcsum, iconcsumlen); | 121 byte_stream_putraw(&bs, iconcsum, iconcsumlen); |
122 | 122 |
123 snacid = aim_cachesnac(od, 0x0010, 0x0004, 0x0000, NULL, 0); | 123 snacid = aim_cachesnac(od, SNAC_FAMILY_BART, 0x0004, 0x0000, NULL, 0); |
124 flap_connection_send_snac(od, conn, 0x0010, 0x0004, 0x0000, snacid, &bs); | 124 flap_connection_send_snac(od, conn, SNAC_FAMILY_BART, 0x0004, 0x0000, snacid, &bs); |
125 | 125 |
126 byte_stream_destroy(&bs); | 126 byte_stream_destroy(&bs); |
127 | 127 |
128 return 0; | 128 return 0; |
129 } | 129 } |
172 } | 172 } |
173 | 173 |
174 int | 174 int |
175 bart_modfirst(OscarData *od, aim_module_t *mod) | 175 bart_modfirst(OscarData *od, aim_module_t *mod) |
176 { | 176 { |
177 mod->family = 0x0010; | 177 mod->family = SNAC_FAMILY_BART; |
178 mod->version = 0x0001; | 178 mod->version = 0x0001; |
179 mod->toolid = 0x0010; | 179 mod->toolid = 0x0010; |
180 mod->toolversion = 0x0629; | 180 mod->toolversion = 0x0629; |
181 mod->flags = 0; | 181 mod->flags = 0; |
182 strncpy(mod->name, "bart", sizeof(mod->name)); | 182 strncpy(mod->name, "bart", sizeof(mod->name)); |