Sun, 16 May 2010 05:57:08 +0000
oscar: g_malloc can't fail (in a way that doesn't abort)
| 13235 | 1 | /* |
| 15884 | 2 | * Purple's oscar protocol plugin |
| 13235 | 3 | * This file is the legal property of its developers. |
| 4 | * Please see the AUTHORS file distributed alongside this file. | |
| 5 | * | |
| 6 | * This library is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU Lesser General Public | |
| 8 | * License as published by the Free Software Foundation; either | |
| 9 | * version 2 of the License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This library is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * Lesser General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU Lesser General Public | |
| 17 | * License along with this library; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17443
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 13235 | 19 | */ |
| 20 | ||
| 21 | /* | |
| 22 | * Family 0x0007 - Account Administration. | |
| 23 | * | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
23456
diff
changeset
|
24 | * Used for stuff like changing the formating of your username, changing your |
| 13235 | 25 | * email address, requesting an account confirmation email, getting account info, |
| 26 | */ | |
| 27 | ||
| 28 | #include "oscar.h" | |
| 29 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
30 | /** |
| 13235 | 31 | * Subtype 0x0002 - Request a bit of account info. |
| 32 | * | |
| 33 | * Info should be one of the following: | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
23456
diff
changeset
|
34 | * 0x0001 - Username formatting |
| 13235 | 35 | * 0x0011 - Email address |
| 36 | * 0x0013 - Unknown | |
| 37 | */ | |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
38 | void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
39 | aim_admin_getinfo(OscarData *od, FlapConnection *conn, guint16 info) |
| 13235 | 40 | { |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
41 | ByteStream bs; |
| 13235 | 42 | aim_snacid_t snacid; |
| 43 | ||
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
44 | byte_stream_new(&bs, 4); |
| 13235 | 45 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
46 | byte_stream_put16(&bs, info); |
|
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
47 | byte_stream_put16(&bs, 0x0000); |
| 13235 | 48 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
49 | snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0002, 0x0000, NULL, 0); |
|
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
50 | flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0002, 0x0000, snacid, &bs); |
| 13235 | 51 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
52 | byte_stream_destroy(&bs); |
| 13235 | 53 | } |
| 54 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
55 | /** |
| 13235 | 56 | * Subtypes 0x0003 and 0x0005 - Parse account info. |
| 57 | * | |
| 58 | * Called in reply to both an information request (subtype 0x0002) and | |
| 59 | * an information change (subtype 0x0004). | |
| 60 | */ | |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
61 | static void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
62 | infochange(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 63 | { |
| 64 | aim_rxcallback_t userfunc; | |
| 65 | char *url=NULL, *sn=NULL, *email=NULL; | |
| 66 | guint16 perms, tlvcount, err=0; | |
| 67 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
68 | perms = byte_stream_get16(bs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
69 | tlvcount = byte_stream_get16(bs); |
| 13235 | 70 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
71 | while (tlvcount && byte_stream_empty(bs)) { |
| 13235 | 72 | guint16 type, length; |
| 73 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
74 | type = byte_stream_get16(bs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
75 | length = byte_stream_get16(bs); |
| 13235 | 76 | |
| 77 | switch (type) { | |
| 78 | case 0x0001: { | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
79 | g_free(sn); |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
80 | sn = byte_stream_getstr(bs, length); |
| 13235 | 81 | } break; |
| 82 | ||
| 83 | case 0x0004: { | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
84 | g_free(url); |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
85 | url = byte_stream_getstr(bs, length); |
| 13235 | 86 | } break; |
| 87 | ||
| 88 | case 0x0008: { | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
89 | err = byte_stream_get16(bs); |
| 13235 | 90 | } break; |
| 91 | ||
| 92 | case 0x0011: { | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
93 | g_free(email); |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
94 | if (length == 0) |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
95 | email = g_strdup("*suppressed"); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
96 | else |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
97 | email = byte_stream_getstr(bs, length); |
| 13235 | 98 | } break; |
| 99 | } | |
| 100 | ||
| 101 | tlvcount--; | |
| 102 | } | |
| 103 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
104 | if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
105 | userfunc(od, conn, frame, (snac->subtype == 0x0005) ? 1 : 0, perms, err, url, sn, email); |
| 13235 | 106 | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
107 | g_free(sn); |
|
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
108 | g_free(url); |
|
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
109 | g_free(email); |
| 13235 | 110 | } |
| 111 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
112 | /** |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
23456
diff
changeset
|
113 | * Subtype 0x0004 - Set the formatting of username (change spaces and capitalization). |
| 13235 | 114 | */ |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
115 | void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
116 | aim_admin_setnick(OscarData *od, FlapConnection *conn, const char *newnick) |
| 13235 | 117 | { |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
118 | ByteStream bs; |
| 13235 | 119 | aim_snacid_t snacid; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
120 | GSList *tlvlist = NULL; |
| 13235 | 121 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
122 | byte_stream_new(&bs, 2+2+strlen(newnick)); |
| 13235 | 123 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
124 | aim_tlvlist_add_str(&tlvlist, 0x0001, newnick); |
| 13235 | 125 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
126 | aim_tlvlist_write(&bs, &tlvlist); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
127 | aim_tlvlist_free(tlvlist); |
| 13235 | 128 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
129 | snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); |
|
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
130 | flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); |
| 13235 | 131 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
132 | byte_stream_destroy(&bs); |
| 13235 | 133 | } |
| 134 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
135 | /** |
| 13235 | 136 | * Subtype 0x0004 - Change password. |
| 137 | */ | |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
138 | void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
139 | aim_admin_changepasswd(OscarData *od, FlapConnection *conn, const char *newpw, const char *curpw) |
| 13235 | 140 | { |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
141 | ByteStream bs; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
142 | GSList *tlvlist = NULL; |
| 13235 | 143 | aim_snacid_t snacid; |
| 144 | ||
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
145 | byte_stream_new(&bs, 4+strlen(curpw)+4+strlen(newpw)); |
| 13235 | 146 | |
| 147 | /* new password TLV t(0002) */ | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
148 | aim_tlvlist_add_str(&tlvlist, 0x0002, newpw); |
| 13235 | 149 | |
| 150 | /* current password TLV t(0012) */ | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
151 | aim_tlvlist_add_str(&tlvlist, 0x0012, curpw); |
| 13235 | 152 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
153 | aim_tlvlist_write(&bs, &tlvlist); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
154 | aim_tlvlist_free(tlvlist); |
| 13235 | 155 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
156 | snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); |
|
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
157 | flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); |
| 13235 | 158 | |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
159 | byte_stream_destroy(&bs); |
| 13235 | 160 | } |
| 161 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
162 | /** |
| 13235 | 163 | * Subtype 0x0004 - Change email address. |
| 164 | */ | |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
165 | void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
166 | aim_admin_setemail(OscarData *od, FlapConnection *conn, const char *newemail) |
| 13235 | 167 | { |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
168 | ByteStream bs; |
| 13235 | 169 | aim_snacid_t snacid; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
170 | GSList *tlvlist = NULL; |
| 13235 | 171 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
172 | byte_stream_new(&bs, 2+2+strlen(newemail)); |
| 13235 | 173 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
174 | aim_tlvlist_add_str(&tlvlist, 0x0011, newemail); |
| 13235 | 175 | |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
176 | aim_tlvlist_write(&bs, &tlvlist); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
177 | aim_tlvlist_free(tlvlist); |
| 13235 | 178 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
179 | snacid = aim_cachesnac(od, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, NULL, 0); |
|
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
180 | flap_connection_send_snac(od, conn, SNAC_FAMILY_ADMIN, 0x0004, 0x0000, snacid, &bs); |
|
22860
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
181 | |
|
2b0e247173b2
All SNACs on FLAP channel 2 except in the auth family are now sent through
Evan Schoenberg <evands@pidgin.im>
parents:
19859
diff
changeset
|
182 | byte_stream_destroy(&bs); |
| 13235 | 183 | } |
| 184 | ||
| 185 | /* | |
| 186 | * Subtype 0x0006 - Request account confirmation. | |
| 187 | * | |
| 188 | * This will cause an email to be sent to the address associated with | |
| 189 | * the account. By following the instructions in the mail, you can | |
| 190 | * get the TRIAL flag removed from your account. | |
| 191 | * | |
| 192 | */ | |
|
15147
101192282f5d
[gaim-migrate @ 17871]
Mark Doliner <markdoliner@pidgin.im>
parents:
14254
diff
changeset
|
193 | void |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
194 | aim_admin_reqconfirm(OscarData *od, FlapConnection *conn) |
| 13235 | 195 | { |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
196 | aim_genericreq_n(od, conn, SNAC_FAMILY_ADMIN, 0x0006); |
| 13235 | 197 | } |
| 198 | ||
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
199 | /** |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
200 | * Subtype SNAC_FAMILY_ADMIN - Account confirmation request acknowledgement. |
| 13235 | 201 | */ |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
202 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
203 | accountconfirm(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 204 | { |
| 205 | int ret = 0; | |
| 206 | aim_rxcallback_t userfunc; | |
| 207 | guint16 status; | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
208 | /* GSList *tlvlist; */ |
| 13235 | 209 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
210 | status = byte_stream_get16(bs); |
|
13663
de16367fd001
[gaim-migrate @ 16064]
Mark Doliner <markdoliner@pidgin.im>
parents:
13652
diff
changeset
|
211 | /* Status is 0x0013 if unable to confirm at this time */ |
| 13235 | 212 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
213 | /* tlvlist = aim_tlvlist_read(bs); */ |
| 13235 | 214 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
215 | if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
216 | ret = userfunc(od, conn, frame, status); |
| 13235 | 217 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17280
diff
changeset
|
218 | /* aim_tlvlist_free(tlvlist); */ |
|
13652
efb3f3a56cb6
[gaim-migrate @ 16052]
Mark Doliner <markdoliner@pidgin.im>
parents:
13651
diff
changeset
|
219 | |
| 13235 | 220 | return ret; |
| 221 | } | |
| 222 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
223 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
224 | snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 225 | { |
|
23004
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
226 | if ((snac->subtype == 0x0003) || (snac->subtype == 0x0005)) { |
|
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
227 | infochange(od, conn, mod, frame, snac, bs); |
|
0d9272ff5e50
Minor changes... mostly whitespace related.
Mark Doliner <markdoliner@pidgin.im>
parents:
22891
diff
changeset
|
228 | return 1; |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
229 | } else if (snac->subtype == SNAC_FAMILY_ADMIN) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
230 | return accountconfirm(od, conn, mod, frame, snac, bs); |
| 13235 | 231 | |
| 232 | return 0; | |
| 233 | } | |
| 234 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
235 | int admin_modfirst(OscarData *od, aim_module_t *mod) |
| 13235 | 236 | { |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23004
diff
changeset
|
237 | mod->family = SNAC_FAMILY_ADMIN; |
| 13235 | 238 | mod->version = 0x0001; |
| 239 | mod->toolid = 0x0010; | |
| 240 | mod->toolversion = 0x0629; | |
| 241 | mod->flags = 0; | |
| 242 | strncpy(mod->name, "admin", sizeof(mod->name)); | |
| 243 | mod->snachandler = snachandler; | |
| 244 | ||
| 245 | return 0; | |
| 246 | } |