Mercurial > pidgin
comparison src/protocols/oscar/im.c @ 11000:218cccfb8e48
[gaim-migrate @ 12849]
Get rid of some more warnings.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 10 Jun 2005 04:08:21 +0000 |
parents | 1798ad0be460 |
children | 92453bf9b86b |
comparison
equal
deleted
inserted
replaced
10999:56cfc50d2a81 | 11000:218cccfb8e48 |
---|---|
338 /* Character set */ | 338 /* Character set */ |
339 aimbs_put16(&fr->data, args->charset); | 339 aimbs_put16(&fr->data, args->charset); |
340 aimbs_put16(&fr->data, args->charsubset); | 340 aimbs_put16(&fr->data, args->charsubset); |
341 | 341 |
342 /* Message. Not terminated */ | 342 /* Message. Not terminated */ |
343 aimbs_putraw(&fr->data, args->msg, args->msglen); | 343 aimbs_putstr(&fr->data, args->msg); |
344 } | 344 } |
345 | 345 |
346 /* Set the Autoresponse flag */ | 346 /* Set the Autoresponse flag */ |
347 if (args->flags & AIM_IMFLAGS_AWAY) { | 347 if (args->flags & AIM_IMFLAGS_AWAY) { |
348 aimbs_put16(&fr->data, 0x0004); | 348 aimbs_put16(&fr->data, 0x0004); |
656 aimbs_putle32(&fr->data, 0); | 656 aimbs_putle32(&fr->data, 0); |
657 | 657 |
658 aimbs_putle16(&fr->data, 0x0001); | 658 aimbs_putle16(&fr->data, 0x0001); |
659 aimbs_putle32(&fr->data, 0); | 659 aimbs_putle32(&fr->data, 0); |
660 aimbs_putle16(&fr->data, strlen(args->rtfmsg)+1); | 660 aimbs_putle16(&fr->data, strlen(args->rtfmsg)+1); |
661 aimbs_putraw(&fr->data, args->rtfmsg, strlen(args->rtfmsg)+1); | 661 aimbs_putraw(&fr->data, (fu8_t *)args->rtfmsg, strlen(args->rtfmsg)+1); |
662 | 662 |
663 aimbs_putle32(&fr->data, args->fgcolor); | 663 aimbs_putle32(&fr->data, args->fgcolor); |
664 aimbs_putle32(&fr->data, args->bgcolor); | 664 aimbs_putle32(&fr->data, args->bgcolor); |
665 aimbs_putle32(&fr->data, strlen(rtfcap)+1); | 665 aimbs_putle32(&fr->data, strlen(rtfcap)+1); |
666 aimbs_putraw(&fr->data, rtfcap, strlen(rtfcap)+1); | 666 aimbs_putraw(&fr->data, (fu8_t *)rtfcap, strlen(rtfcap)+1); |
667 | 667 |
668 aim_tx_enqueue(sess, fr); | 668 aim_tx_enqueue(sess, fr); |
669 | 669 |
670 return 0; | 670 return 0; |
671 } | 671 } |
1026 * @param sn The destination screen name. | 1026 * @param sn The destination screen name. |
1027 * @param type The type of message. 0x0007 for authorization denied. 0x0008 for authorization granted. | 1027 * @param type The type of message. 0x0007 for authorization denied. 0x0008 for authorization granted. |
1028 * @param message The message you want to send, it should be null terminated. | 1028 * @param message The message you want to send, it should be null terminated. |
1029 * @return Return 0 if no errors, otherwise return the error number. | 1029 * @return Return 0 if no errors, otherwise return the error number. |
1030 */ | 1030 */ |
1031 faim_export int aim_im_sendch4(aim_session_t *sess, char *sn, fu16_t type, fu8_t *message) | 1031 faim_export int aim_im_sendch4(aim_session_t *sess, const char *sn, fu16_t type, const char *message) |
1032 { | 1032 { |
1033 aim_conn_t *conn; | 1033 aim_conn_t *conn; |
1034 aim_frame_t *fr; | 1034 aim_frame_t *fr; |
1035 aim_snacid_t snacid; | 1035 aim_snacid_t snacid; |
1036 int i; | 1036 int i; |
1037 char ck[8]; | 1037 fu8_t ck[8]; |
1038 | 1038 |
1039 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0002))) | 1039 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0002))) |
1040 return -EINVAL; | 1040 return -EINVAL; |
1041 | 1041 |
1042 if (!sn || !type || !message) | 1042 if (!sn || !type || !message) |
1071 /* | 1071 /* |
1072 * TLV t(type) l(strlen(message)+1) v(message+NULL) | 1072 * TLV t(type) l(strlen(message)+1) v(message+NULL) |
1073 */ | 1073 */ |
1074 aimbs_putle16(&fr->data, type); | 1074 aimbs_putle16(&fr->data, type); |
1075 aimbs_putle16(&fr->data, strlen(message)+1); | 1075 aimbs_putle16(&fr->data, strlen(message)+1); |
1076 aimbs_putraw(&fr->data, message, strlen(message)+1); | 1076 aimbs_putraw(&fr->data, (fu8_t *)message, strlen(message)+1); |
1077 | 1077 |
1078 /* | 1078 /* |
1079 * TLV t(0006) l(0000) v() | 1079 * TLV t(0006) l(0000) v() |
1080 */ | 1080 */ |
1081 aimbs_put16(&fr->data, 0x0006); | 1081 aimbs_put16(&fr->data, 0x0006); |
1141 msglen = aimbs_get16(&mbs) - 4; /* final block length */ | 1141 msglen = aimbs_get16(&mbs) - 4; /* final block length */ |
1142 | 1142 |
1143 flag1 = aimbs_get16(&mbs); | 1143 flag1 = aimbs_get16(&mbs); |
1144 flag2 = aimbs_get16(&mbs); | 1144 flag2 = aimbs_get16(&mbs); |
1145 | 1145 |
1146 msg = aimbs_getstr(&mbs, msglen); | 1146 msg = aimbs_getraw(&mbs, msglen); |
1147 } | 1147 } |
1148 | 1148 |
1149 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) | 1149 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
1150 ret = userfunc(sess, rx, channel, sn, msg, icbmflags, flag1, flag2); | 1150 ret = userfunc(sess, rx, channel, sn, msg, icbmflags, flag1, flag2); |
1151 | 1151 |
1247 /* XXX - should provide a way of saying ISO-8859-1 specifically */ | 1247 /* XXX - should provide a way of saying ISO-8859-1 specifically */ |
1248 faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii) | 1248 faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii) |
1249 { | 1249 { |
1250 fu8_t *dup; | 1250 fu8_t *dup; |
1251 | 1251 |
1252 if (!(dup = strdup(ascii))) | 1252 if (!(dup = (fu8_t *)strdup(ascii))) |
1253 return -1; | 1253 return -1; |
1254 | 1254 |
1255 if (mpmsg_addsection(sess, mpm, 0x0000, 0x0000, dup, strlen(ascii)) == -1) { | 1255 if (mpmsg_addsection(sess, mpm, 0x0000, 0x0000, dup, strlen(ascii)) == -1) { |
1256 free(dup); | 1256 free(dup); |
1257 return -1; | 1257 return -1; |
1356 * XXX - There's an API bug here. For sending, the UNICODE is | 1356 * XXX - There's an API bug here. For sending, the UNICODE is |
1357 * given in host byte order (aim_mpmsg_addunicode), but here | 1357 * given in host byte order (aim_mpmsg_addunicode), but here |
1358 * the received messages are given in network byte order. | 1358 * the received messages are given in network byte order. |
1359 * | 1359 * |
1360 */ | 1360 */ |
1361 msgbuf = aimbs_getstr(&mbs, msglen); | 1361 msgbuf = aimbs_getraw(&mbs, msglen); |
1362 mpmsg_addsection(sess, &args->mpmsg, flag1, flag2, msgbuf, msglen); | 1362 mpmsg_addsection(sess, &args->mpmsg, flag1, flag2, msgbuf, msglen); |
1363 | 1363 |
1364 } /* while */ | 1364 } /* while */ |
1365 | 1365 |
1366 args->icbmflags |= AIM_IMFLAGS_MULTIPART; /* always set */ | 1366 args->icbmflags |= AIM_IMFLAGS_MULTIPART; /* always set */ |
2140 * AIM_TRANSFER_DENY_NOTSUPPORTED -- "client does not support" | 2140 * AIM_TRANSFER_DENY_NOTSUPPORTED -- "client does not support" |
2141 * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer" | 2141 * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer" |
2142 * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" | 2142 * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" |
2143 * | 2143 * |
2144 */ | 2144 */ |
2145 faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const char *cookie, fu16_t code) | 2145 faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const fu8_t *cookie, fu16_t code) |
2146 { | 2146 { |
2147 aim_conn_t *conn; | 2147 aim_conn_t *conn; |
2148 aim_frame_t *fr; | 2148 aim_frame_t *fr; |
2149 aim_snacid_t snacid; | 2149 aim_snacid_t snacid; |
2150 aim_tlvlist_t *tl = NULL; | 2150 aim_tlvlist_t *tl = NULL; |