* Fixed some bugs in the ICQ metaclient, and documented the new protocol cmds
authorArt Cancro <ajc@citadel.org>
Wed, 4 Aug 1999 02:21:47 +0000 (02:21 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 4 Aug 1999 02:21:47 +0000 (02:21 +0000)
citadel/ChangeLog
citadel/serv_icq.c
citadel/techdoc/session.txt

index 2432a5cb4710e33bf8aa06aeab0505a608c274c1..6182a1af3d7d81b7d4d7081cdb52add21ae57e4e 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 1.345  1999/08/04 02:21:45  ajc
+* Fixed some bugs in the ICQ metaclient, and documented the new protocol cmds
+
 Revision 1.344  1999/08/03 11:34:35  ajc
 * Added client_icq.c and client_icq.h
 
@@ -1173,4 +1176,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 6195f31ef8bb6c028e8b777346dae373b3f2686f..bb3cd51ff5656dde173654fd7b338f1f56008289 100644 (file)
@@ -1976,6 +1976,12 @@ void CtdlICQ_Refresh_Contact_List(void) {
        }
 
        icq_SendContactList();
+
+       if (ThisICQ->icq_numcl) for (i=0; i<ThisICQ->icq_numcl; ++i) {
+               if (ThisICQ->icq_cl[i].uin > 0L) {
+                       icq_SendInfoReq(ThisICQ->icq_cl[i].uin);
+               }
+       }
 }
 
 
@@ -2058,7 +2064,7 @@ void CtdlICQ_session_stopdown_hook(void) {
 void CtdlICQ_after_cmd_hook(void)
 {
        if (ThisICQ->icq_Sok >= 0) {
-               if ( (time(NULL) - ThisICQ->icq_LastKeepAlive) > 90 ) {
+               if ( (time(NULL) - ThisICQ->icq_LastKeepAlive) > 60 ) {
                        icq_KeepAlive();
                        ThisICQ->icq_LastKeepAlive = time(NULL);
                }
@@ -2107,8 +2113,18 @@ void CtdlICQ_Incoming_Message(DWORD uin, BYTE hour, BYTE minute,
        
        char from[256];
        int num_delivered;
+       int i;
 
+       /* Default sender is 'uin@icq' syntax */
        sprintf(from, "%ld@icq", uin);
+
+       /* Use the sender's name if we have it  inthe contact list */
+       if (ThisICQ->icq_numcl) for (i=0; i<ThisICQ->icq_numcl; ++i) {
+               if (uin == ThisICQ->icq_cl[i].uin) {
+                       safestrncpy(from, ThisICQ->icq_cl[i].name, 256);
+               }
+       }
+
        num_delivered = PerformXmsgHooks(from, CC->curr_user, (char *)msg);
        lprintf(9, "Delivered to %d users\n", num_delivered);
 }
@@ -2121,6 +2137,7 @@ void CtdlICQ_InfoReply(unsigned long uin, const char *nick,
 
        struct CtdlICQ_CL *ptr;
        
+       CtdlICQ_Read_CL();
        ptr = CtdlICQ_CLent(uin);
        safestrncpy(ptr->name, nick, 32);
        ptr->status = STATUS_OFFLINE;
@@ -2234,7 +2251,6 @@ void cmd_cicq(char *argbuf) {
                        uin = extract_long(buf, 0);
                        if (uin > 0L) {
                                CtdlICQ_CLent(uin);
-                               icq_SendInfoReq(uin);
                        }
                }
                CtdlICQ_Write_CL();
index 4e5e7db20c7ac8c7cefc60c56b14ebe65acb3349..23bc4194b9066df181ff3dd18ef5636f71e583af 100644 (file)
@@ -1677,3 +1677,36 @@ execute a random GEXP every now and then.  Or, it can check the byte in
 server return code messages, between the return code and the parameters.  In
 much the same way as FTP uses "-" to signify a continuation, Citadel uses
 an "*" in this position to signify the presence of waiting express messages.
+  
+ CICQ   (Citadel ICQ metaclient setup)
+ If a Citadel server has the ICQ Metaclient installed, this command is used
+to configure it.  It has several usages:
+ CICQ login|uin|pass
+  This tells Citadel the user's ICQ uin (second argument) and password (third
+argument).  When called in this fashion, CICQ will return either OK or ERROR.
+It should be noted, however, that the only way an ERROR code can be returned
+is if the uin and/or password is not supplied.  Authentication failures cannot
+be immediately detected, because the ICQ protocol is asynchronous.
+ CICQ getcl
+ Request the current contact list.  If successful, CICQ will return
+LISTING_FOLLOWS followed by zero or more contacts in the format 
+   
+   uin|nickname|status
+ CICQ putcl
+ Upload a new contact list.  If successful, CICQ will return SEND_LISTING
+after which the client should transmit zero or more uin's, one per line.  The
+server will then attempt to contact the ICQ server to determine nicknames
+and statuses.
+ CICQ status
+ Always returns OK followed by a 1 (connected to ICQ) or 0 (not connected).