comparison src/protocols/oscar/oscar.c @ 8735:92cbf9713795

[gaim-migrate @ 9490] Patch by Jonathan Champ to corect the vairous speling mistakes we hav e in the coments and documentaion. Thansk Jonathan! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 21 Apr 2004 01:34:26 +0000
parents 18cfabf507d5
children d7b8eb1f0a18
comparison
equal deleted inserted replaced
8734:407c122d6191 8735:92cbf9713795
343 static gchar *oscar_encoding_extract(const char *encoding) 343 static gchar *oscar_encoding_extract(const char *encoding)
344 { 344 {
345 gchar *ret = NULL; 345 gchar *ret = NULL;
346 char *begin, *end; 346 char *begin, *end;
347 347
348 /* Make sure encoding begings with charset= */ 348 /* Make sure encoding begins with charset= */
349 if (strncmp(encoding, "text/aolrtf; charset=", 21)) 349 if (strncmp(encoding, "text/aolrtf; charset=", 21))
350 return NULL; 350 return NULL;
351 351
352 begin = strchr(encoding, '"'); 352 begin = strchr(encoding, '"');
353 end = strrchr(encoding, '"'); 353 end = strrchr(encoding, '"');
1047 * so I wrote a little explanation of what happens. I am such a 1047 * so I wrote a little explanation of what happens. I am such a
1048 * ninja. 1048 * ninja.
1049 * 1049 *
1050 * The series of events for a file send is: 1050 * The series of events for a file send is:
1051 * -Create xfer and call gaim_xfer_request (this happens in oscar_ask_sendfile) 1051 * -Create xfer and call gaim_xfer_request (this happens in oscar_ask_sendfile)
1052 * -User chooses a file and oscar_xfer_init is called. It establishs a 1052 * -User chooses a file and oscar_xfer_init is called. It establishes a
1053 * listening socket, then asks the remote user to connect to us (and 1053 * listening socket, then asks the remote user to connect to us (and
1054 * gives them the file name, port, IP, etc.) 1054 * gives them the file name, port, IP, etc.)
1055 * -They connect to us and we send them an AIM_CB_OFT_PROMPT (this happens 1055 * -They connect to us and we send them an AIM_CB_OFT_PROMPT (this happens
1056 * in oscar_sendfile_estblsh) 1056 * in oscar_sendfile_estblsh)
1057 * -They send us an AIM_CB_OFT_ACK and then we start sending data 1057 * -They send us an AIM_CB_OFT_ACK and then we start sending data
1066 * -It connects to the remote user using the IP they gave us earlier 1066 * -It connects to the remote user using the IP they gave us earlier
1067 * -After connecting, they send us an AIM_CB_OFT_PROMPT. In reply, we send 1067 * -After connecting, they send us an AIM_CB_OFT_PROMPT. In reply, we send
1068 * them an AIM_CB_OFT_ACK. 1068 * them an AIM_CB_OFT_ACK.
1069 * -They begin to send us lots of raw data. 1069 * -They begin to send us lots of raw data.
1070 * -When they finish sending data we send an AIM_CB_OFT_DONE and then close 1070 * -When they finish sending data we send an AIM_CB_OFT_DONE and then close
1071 * the connectionn. 1071 * the connection.
1072 */ 1072 */
1073 static void oscar_sendfile_connected(gpointer data, gint source, GaimInputCondition condition); 1073 static void oscar_sendfile_connected(gpointer data, gint source, GaimInputCondition condition);
1074 1074
1075 /* 1075 /*
1076 * Miscellaneous xfer functions 1076 * Miscellaneous xfer functions
2623 return 1; 2623 return 1;
2624 } 2624 }
2625 2625
2626 if (args->info.sendfile.subtype == AIM_OFT_SUBTYPE_SEND_DIR) { 2626 if (args->info.sendfile.subtype == AIM_OFT_SUBTYPE_SEND_DIR) {
2627 /* last char of the ft req is a star, they are sending us a 2627 /* last char of the ft req is a star, they are sending us a
2628 * directory -- remove the star and trailing slash so we dont save 2628 * directory -- remove the star and trailing slash so we don't save
2629 * directories that look like 'dirname\*' -- arl */ 2629 * directories that look like 'dirname\*' -- arl */
2630 char *tmp = strrchr(args->info.sendfile.filename, '\\'); 2630 char *tmp = strrchr(args->info.sendfile.filename, '\\');
2631 if (tmp && (tmp[1] == '*')) { 2631 if (tmp && (tmp[1] == '*')) {
2632 tmp[0] = '\0'; 2632 tmp[0] = '\0';
2633 } 2633 }
3041 struct aim_incomingim_ch1_args *args; 3041 struct aim_incomingim_ch1_args *args;
3042 args = va_arg(ap, struct aim_incomingim_ch1_args *); 3042 args = va_arg(ap, struct aim_incomingim_ch1_args *);
3043 ret = incomingim_chan1(sess, fr->conn, userinfo, args); 3043 ret = incomingim_chan1(sess, fr->conn, userinfo, args);
3044 } break; 3044 } break;
3045 3045
3046 case 2: { /* rendevous */ 3046 case 2: { /* rendezvous */
3047 struct aim_incomingim_ch2_args *args; 3047 struct aim_incomingim_ch2_args *args;
3048 args = va_arg(ap, struct aim_incomingim_ch2_args *); 3048 args = va_arg(ap, struct aim_incomingim_ch2_args *);
3049 ret = incomingim_chan2(sess, fr->conn, userinfo, args); 3049 ret = incomingim_chan2(sess, fr->conn, userinfo, args);
3050 } break; 3050 } break;
3051 3051
5971 * data chunks (images) appended to it. 5971 * data chunks (images) appended to it.
5972 * 5972 *
5973 * This function rips out all the data chunks and creates an imgstore for 5973 * This function rips out all the data chunks and creates an imgstore for
5974 * each one. In order to do this, it first goes through the IM and takes 5974 * each one. In order to do this, it first goes through the IM and takes
5975 * out all the IMG tags. When doing so, it rewrites the original IMG tag 5975 * out all the IMG tags. When doing so, it rewrites the original IMG tag
5976 * with one compatable with the imgstore Gaim core code. For each one, we 5976 * with one compatible with the imgstore Gaim core code. For each one, we
5977 * then read in chunks of data from the end of the message and actually 5977 * then read in chunks of data from the end of the message and actually
5978 * create the img store using the given data. 5978 * create the img store using the given data.
5979 * 5979 *
5980 * For somewhat easy reference, here's a sample message 5980 * For somewhat easy reference, here's a sample message
5981 * (without the whitespace and asterisks): 5981 * (without the whitespace and asterisks):