From b9a502c222c412f02709af577e6dd471765ea1b5 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 4 Aug 1999 02:21:47 +0000 Subject: [PATCH] * Fixed some bugs in the ICQ metaclient, and documented the new protocol cmds --- citadel/ChangeLog | 4 +++- citadel/serv_icq.c | 20 ++++++++++++++++++-- citadel/techdoc/session.txt | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 2432a5cb4..6182a1af3 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/serv_icq.c b/citadel/serv_icq.c index 6195f31ef..bb3cd51ff 100644 --- a/citadel/serv_icq.c +++ b/citadel/serv_icq.c @@ -1976,6 +1976,12 @@ void CtdlICQ_Refresh_Contact_List(void) { } icq_SendContactList(); + + if (ThisICQ->icq_numcl) for (i=0; iicq_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; iicq_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(); diff --git a/citadel/techdoc/session.txt b/citadel/techdoc/session.txt index 4e5e7db20..23bc4194b 100644 --- a/citadel/techdoc/session.txt +++ b/citadel/techdoc/session.txt @@ -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). -- 2.39.2