comparison libfaim/aim_im.c @ 840:595ac7759563

[gaim-migrate @ 850] lots of (mostly useless for us) libfaim changes. should help portability, but it was always portable between unices.... stupid win32ers. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 04 Sep 2000 23:37:32 +0000
parents 88f8f98de02d
children e1da6a6ec42b
comparison
equal deleted inserted replaced
839:8f66e00af045 840:595ac7759563
15 * AIM_IMFLAGS_AWAY -- Marks the message as an autoresponse 15 * AIM_IMFLAGS_AWAY -- Marks the message as an autoresponse
16 * AIM_IMFLAGS_ACK -- Requests that the server send an ack 16 * AIM_IMFLAGS_ACK -- Requests that the server send an ack
17 * when the message is received (of type 0x0004/0x000c) 17 * when the message is received (of type 0x0004/0x000c)
18 * 18 *
19 */ 19 */
20 u_long aim_send_im(struct aim_session_t *sess, 20 faim_export unsigned long aim_send_im(struct aim_session_t *sess,
21 struct aim_conn_t *conn, 21 struct aim_conn_t *conn,
22 char *destsn, u_int flags, char *msg) 22 char *destsn, u_int flags, char *msg)
23 { 23 {
24 24
25 int curbyte,i; 25 int curbyte,i;
26 struct command_tx_struct *newpacket; 26 struct command_tx_struct *newpacket;
27 27
137 #endif 137 #endif
138 138
139 return (sess->snac_nextid++); 139 return (sess->snac_nextid++);
140 } 140 }
141 141
142 int aim_parse_outgoing_im_middle(struct aim_session_t *sess, 142 faim_internal int aim_parse_outgoing_im_middle(struct aim_session_t *sess,
143 struct command_rx_struct *command) 143 struct command_rx_struct *command)
144 { 144 {
145 unsigned int i = 0, z; 145 unsigned int i = 0, z;
146 rxcallback_t userfunc = NULL; 146 rxcallback_t userfunc = NULL;
147 unsigned char cookie[8]; 147 unsigned char cookie[8];
148 int channel; 148 int channel;
165 if (channel != 0x01) { 165 if (channel != 0x01) {
166 printf("faim: icbm: ICBM recieved on unsupported channel. Ignoring. (chan = %04x)\n", channel); 166 printf("faim: icbm: ICBM recieved on unsupported channel. Ignoring. (chan = %04x)\n", channel);
167 return 1; 167 return 1;
168 } 168 }
169 169
170 strncpy(sn, command->data+i+1, (int) *(command->data+i)); 170 strncpy(sn, (char *) command->data+i+1, (int) *(command->data+i));
171 i += 1 + (int) *(command->data+i); 171 i += 1 + (int) *(command->data+i);
172 172
173 tlvlist = aim_readtlvchain(command->data+i, command->commandlen-i); 173 tlvlist = aim_readtlvchain(command->data+i, command->commandlen-i);
174 174
175 if (aim_gettlv(tlvlist, 0x0003, 1)) 175 if (aim_gettlv(tlvlist, 0x0003, 1))
178 icbmflags |= AIM_IMFLAGS_AWAY; 178 icbmflags |= AIM_IMFLAGS_AWAY;
179 179
180 if (aim_gettlv(tlvlist, 0x0002, 1)) { 180 if (aim_gettlv(tlvlist, 0x0002, 1)) {
181 int j = 0; 181 int j = 0;
182 182
183 msgblock = aim_gettlv_str(tlvlist, 0x0002, 1); 183 msgblock = (unsigned char *)aim_gettlv_str(tlvlist, 0x0002, 1);
184 184
185 /* no, this really is correct. I'm not high or anything either. */ 185 /* no, this really is correct. I'm not high or anything either. */
186 j += 2; 186 j += 2;
187 j += 2 + aimutil_get16(msgblock+j); 187 j += 2 + aimutil_get16(msgblock+j);
188 j += 2; 188 j += 2;
220 * We should also support at least minimal parsing of 220 * We should also support at least minimal parsing of
221 * Channel 2, so that we can at least know the name of the 221 * Channel 2, so that we can at least know the name of the
222 * room we're invited to, but obviously can't attend... 222 * room we're invited to, but obviously can't attend...
223 * 223 *
224 */ 224 */
225 int aim_parse_incoming_im_middle(struct aim_session_t *sess, 225 faim_internal int aim_parse_incoming_im_middle(struct aim_session_t *sess,
226 struct command_rx_struct *command) 226 struct command_rx_struct *command)
227 { 227 {
228 u_int i = 0,z; 228 u_int i = 0,z;
229 rxcallback_t userfunc = NULL; 229 rxcallback_t userfunc = NULL;
230 u_char cookie[8]; 230 u_char cookie[8];
231 int channel; 231 int channel;
783 * AIM_TRANSFER_DENY_NOTSUPPORTED -- "client does not support" 783 * AIM_TRANSFER_DENY_NOTSUPPORTED -- "client does not support"
784 * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer" 784 * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer"
785 * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" 785 * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers"
786 * 786 *
787 */ 787 */
788 u_long aim_denytransfer(struct aim_session_t *sess, 788 faim_export unsigned long aim_denytransfer(struct aim_session_t *sess,
789 struct aim_conn_t *conn, 789 struct aim_conn_t *conn,
790 char *sender, 790 char *sender,
791 char *cookie, 791 char *cookie,
792 unsigned short code) 792 unsigned short code)
793 { 793 {
794 struct command_tx_struct *newpacket; 794 struct command_tx_struct *newpacket;
795 int curbyte, i; 795 int curbyte, i;
796 796
797 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+8+2+1+strlen(sender)+6))) 797 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+8+2+1+strlen(sender)+6)))
818 * 818 *
819 * Didn't use to send it. But now I think it might be a good 819 * Didn't use to send it. But now I think it might be a good
820 * idea. 820 * idea.
821 * 821 *
822 */ 822 */
823 u_long aim_seticbmparam(struct aim_session_t *sess, 823 faim_export unsigned long aim_seticbmparam(struct aim_session_t *sess,
824 struct aim_conn_t *conn) 824 struct aim_conn_t *conn)
825 { 825 {
826 struct command_tx_struct *newpacket; 826 struct command_tx_struct *newpacket;
827 int curbyte; 827 int curbyte;
828 828
829 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+16))) 829 if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+16)))
847 aim_tx_enqueue(sess, newpacket); 847 aim_tx_enqueue(sess, newpacket);
848 848
849 return (sess->snac_nextid++); 849 return (sess->snac_nextid++);
850 } 850 }
851 851
852 int aim_parse_msgerror_middle(struct aim_session_t *sess, 852 faim_internal int aim_parse_msgerror_middle(struct aim_session_t *sess,
853 struct command_rx_struct *command) 853 struct command_rx_struct *command)
854 { 854 {
855 u_long snacid = 0x000000000; 855 u_long snacid = 0x000000000;
856 struct aim_snac_t *snac = NULL; 856 struct aim_snac_t *snac = NULL;
857 int ret = 0; 857 int ret = 0;
858 rxcallback_t userfunc = NULL; 858 rxcallback_t userfunc = NULL;
896 896
897 return ret; 897 return ret;
898 } 898 }
899 899
900 900
901 int aim_parse_missedcall(struct aim_session_t *sess, 901 faim_internal int aim_parse_missedcall(struct aim_session_t *sess,
902 struct command_rx_struct *command) 902 struct command_rx_struct *command)
903 { 903 {
904 int i, ret = 1; 904 int i, ret = 1;
905 rxcallback_t userfunc = NULL; 905 rxcallback_t userfunc = NULL;
906 unsigned short channel, nummissed, reason; 906 unsigned short channel, nummissed, reason;
907 struct aim_userinfo_s userinfo; 907 struct aim_userinfo_s userinfo;