diff src/protocols/oscar/service.c @ 3952:07283934dedd

[gaim-migrate @ 4133] Ok, big commit with little functionality change. Most of it is me shuffling crap around because I'm one of them neat freaks. Lots of general code cleanup too. I'm trying to move to that whole "one-family-per-file" thing. The details... I added libfaim support for aim's new search family, 0x000f. I only tested this briefly, so if anyone uses it for anything, be aware that it could be buggy. I'll add oscar support sometime. Advantages of this family are... when you search for someone, you get the directory info for that person. So like, first name, middle name, last name, maiden name, city, state, country, zip, address, interests, nickname, and maybe some other stuff. Basically all the info that they've set in their directory info thing. Info. Oh, and I'm calling it "new search" because seach was already taken, and cookie monster ate my right brain. The reason I didn't add support to oscar.c... the new search family requires making a connection to another server. While moving stuff around I realized that I didn't really like how new connections are made. It's kind of sloppy. I'm thinking it would be nice to have an outgoing queue for each type of connection, and then let the client queue messages as much as they want. Then, if libfaim sees that there is a message for a certain type of connection, and there is no open connection of that type, it will connect, and then flush the queue when the connection is made. This seems a lot cleaner, but it also seems like a pain in the ass. I should do ssi for icq first, anyway :-) Also, I think it would be neat if there was an ICBM file that handled channels 1 through 4. Then im.c and chat.c could pass the ICBM part to the icbm stuff and it could get parsed there. im.c is really huge right now. I applied a patch from Graham Booker that paves the way for unicode in direct IMs. Thanks Graham. Now we just need Paco-Paco to git a little free time and write a patch for this. http://sourceforge.net/tracker/index.php?func=detail&aid=633589&group_id=235&atid=300235 I applied 2 patches from Will Mahan dealing with file transfer/oft/rendezous/whatever. Here's some info on them, from The Man himself: Patch 1 "Currently the Rendezvous code is rather messy; this patch attempts to bring it up to speed with the rest of the Oscar prpl. Its changes include: * Rewrite several ft.c functions to use bstreams. Apparently the code in question was written before bstreams were implemented. * Handle incoming Rendezvous packets through the rxqueue like FLAP packets, rather than handling them as a special case as soon as they are received. This takes advantage of the bstream cleanup to unify some code and simplify the aim_frame_t struct. * Change some names used to try to clarify the distinction between OFT, which refers specifically to file transfer, and Rendezvous, which encompasses OFT as well as other types of client-to-client connections." Patch 2 "* Add some comments I inadvertently left out of my last patch. * Fix a double-free that occurs when connections time out. * Correct a bug causing filenames to be truncated by 4 characters on some clients. * Preserve directory structure when sending multiple files. * Handle (throw away) resource forks sent by Mac clients." I also changed all indents to tabs in ft.c. And split all the bstream stuff from rxqueue.c and put it in bstream.c. It really is a separate thing. Especially since it can be used for outgoing connections. Also, I was going to look over the whole patch tonight to make sure it's all good, but it's like 6000 lines, so, uh, I'll do it later. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 13 Nov 2002 07:01:37 +0000
parents 6d62d4520460
children 2532f1192da3
line wrap: on
line diff
--- a/src/protocols/oscar/service.c	Tue Nov 12 03:40:19 2002 +0000
+++ b/src/protocols/oscar/service.c	Wed Nov 13 07:01:37 2002 +0000
@@ -1,5 +1,5 @@
 /*
- * Group 1.  This is a very special group.  All connections support
+ * Family 0x0001 - This is a very special group.  All connections support
  * this group, as it does some particularly good things (like rate limiting).
  */
 
@@ -9,7 +9,7 @@
 
 #include "md5.h"
 
-/* Client Online (group 1, subtype 2) */
+/* Subtype 0x0002 - Client Online */
 faim_export int aim_clientready(aim_session_t *sess, aim_conn_t *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
@@ -48,7 +48,7 @@
 }
 
 /*
- * Host Online (group 1, type 3)
+ * Subtype 0x0003 - Host Online
  * 
  * See comments in conn.c about how the group associations are supposed
  * to work, and how they really work.
@@ -91,13 +91,13 @@
 	return 1; 
 }
 
-/* Service request (group 1, type 4) */
+/* Subtype 0x0004 - Service request */
 faim_export int aim_reqservice(aim_session_t *sess, aim_conn_t *conn, fu16_t serviceid)
 {
 	return aim_genericreq_s(sess, conn, 0x0001, 0x0004, &serviceid);
 }
 
-/* Redirect (group 1, type 5) */
+/* Subtype 0x0005 - Redirect */
 static int redirect(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	struct aim_redirect_data redir;
@@ -147,7 +147,7 @@
 	return ret;
 }
 
-/* Request Rate Information. (group 1, type 6) */
+/* Subtype 0x0006 - Request Rate Information. */
 faim_internal int aim_reqrates(aim_session_t *sess, aim_conn_t *conn)
 {
 	return aim_genericreq_n(sess, conn, 0x0001, 0x0006);
@@ -257,7 +257,7 @@
 	return;
 }
 
-/* Rate Parameters (group 1, type 7) */
+/* Subtype 0x0007 - Rate Parameters */
 static int rateresp(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)rx->conn->inside;
@@ -344,7 +344,7 @@
 	return 1;
 }
 
-/* Add Rate Parameter (group 1, type 8) */
+/* Subtype 0x0008 - Add Rate Parameter */
 faim_internal int aim_rates_addparam(aim_session_t *sess, aim_conn_t *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
@@ -366,7 +366,7 @@
 	return 0;
 }
 
-/* Delete Rate Parameter (group 1, type 9) */
+/* Subtype 0x0009 - Delete Rate Parameter */
 faim_internal int aim_rates_delparam(aim_session_t *sess, aim_conn_t *conn)
 {
 	aim_conn_inside_t *ins = (aim_conn_inside_t *)conn->inside;
@@ -388,7 +388,7 @@
 	return 0;
 }
 
-/* Rate Change (group 1, type 0x0a) */
+/* Subtype 0x000a - Rate Change */
 static int ratechange(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -413,7 +413,7 @@
 }
 
 /*
- * How Migrations work.  
+ * How Migrations work.
  *
  * The server sends a Server Pause message, which the client should respond to 
  * with a Server Pause Ack, which contains the families it needs on this 
@@ -425,7 +425,7 @@
  *
  */
 
-/* Service Pause (group 1, type 0x0b) */
+/* Subtype 0x000b - Service Pause */
 static int serverpause(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -437,7 +437,7 @@
 }
 
 /*
- * Service Pause Acknowledgement (group 1, type 0x0c)
+ * Subtype 0x000c - Service Pause Acknowledgement
  *
  * It is rather important that aim_sendpauseack() gets called for the exact
  * same connection that the Server Pause callback was called for, since
@@ -473,7 +473,7 @@
 	return 0;
 }
 
-/* Service Resume (group 1, type 0x0d) */
+/* Subtype 0x000d - Service Resume */
 static int serverresume(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -484,13 +484,13 @@
 	return 0;
 }
 
-/* Request self-info (group 1, type 0x0e) */
+/* Subtype 0x000e - Request self-info */
 faim_export int aim_reqpersonalinfo(aim_session_t *sess, aim_conn_t *conn)
 {
 	return aim_genericreq_n(sess, conn, 0x0001, 0x000e);
 }
 
-/* Self User Info (group 1, type 0x0f) */
+/* Subtype 0x000f - Self User Info */
 static int selfinfo(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -504,7 +504,7 @@
 	return 0;
 }
 
-/* Evil Notification (group 1, type 0x10) */
+/* Subtype 0x0010 - Evil Notification */
 static int evilnotify(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -525,7 +525,7 @@
 }
 
 /*
- * Idle Notification (group 1, type 0x11)
+ * Subtype 0x0011 - Idle Notification
  *
  * Should set your current idle time in seconds.  Note that this should
  * never be called consecutively with a non-zero idle time.  That makes
@@ -539,7 +539,7 @@
 }
 
 /*
- * Service Migrate (group 1, type 0x12)
+ * Subtype 0x0012 - Service Migrate
  *
  * This is the final SNAC sent on the original connection during a migration.
  * It contains the IP and cookie used to connect to the new server, and 
@@ -591,7 +591,7 @@
 	return ret;
 }
 
-/* Message of the Day (group 1, type 0x13) */
+/* Subtype 0x0013 - Message of the Day */
 static int motd(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -631,7 +631,7 @@
 }
 
 /* 
- * Set privacy flags (group 1, type 0x14)
+ * Subtype 0x0014 - Set privacy flags
  *
  * Normally 0x03.
  *
@@ -645,10 +645,10 @@
 }
 
 /*
- * No-op (group 1, type 0x16)
+ * Subtype 0x0016 - No-op
  *
  * WinAIM sends these every 4min or so to keep the connection alive.  Its not 
- * real necessary.
+ * really necessary.
  *
  */
 faim_export int aim_nop(aim_session_t *sess, aim_conn_t *conn)
@@ -657,7 +657,7 @@
 }
 
 /* 
- * Set client versions (group 1, subtype 0x17) 
+ * Subtype 0x0017 - Set client versions
  *
  * If you've seen the clientonline/clientready SNAC you're probably 
  * wondering what the point of this one is.  And that point seems to be
@@ -704,7 +704,7 @@
 	return 0;
 }
 
-/* Host versions (group 1, subtype 0x18) */
+/* Subtype 0x0018 - Host versions */
 static int hostversions(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	int vercount;
@@ -724,7 +724,7 @@
 }
 
 /* 
- * Set Extended Status (group 1, type 0x1e) 
+ * Subtype 0x001e - Set Extended Status
  *
  * Currently only works if using ICQ.
  *
@@ -790,7 +790,7 @@
  * Anyway, neener.  We win again.
  *
  */
-/* Client verification (group 1, subtype 0x1f) */
+/* Subtype 0x001f - Client verification */
 static int memrequest(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
 {
 	aim_rxcallback_t userfunc;
@@ -838,7 +838,7 @@
 }
 #endif
 
-/* Client verification reply (group 1, subtype 0x20) */
+/* Subtype 0x0020 - Client verification reply */
 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag)
 {
 	aim_frame_t *fr;
@@ -969,4 +969,3 @@
 
 	return 0;
 }
-