]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_icq.c
* Removed all of the thread cancellation cruft that is no longer necessary
[citadel.git] / citadel / serv_icq.c
index da336f7fd9dd8c0b31b0b095b1b3d021dff821d8..30f3dff55809243dfabc47f8173d36cda19820f8 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include <time.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <limits.h>
 #include "sysdep.h"
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
 #include "citadel.h"
 #include "server.h"
 #include "dynloader.h"
 #include "tools.h"
 #include "citserver.h"
+#include "locate_host.h"
 #include "msgbase.h"
 #include "sysdep_decls.h"
 #include "support.h"
@@ -53,17 +52,12 @@ struct CtdlICQ_CL {
        DWORD uin;
        char name[32];
        DWORD status;
-       char host[25];
+       char host[26];
 };
 
 
 /* <ig> */
 
-/* ICQROOM is the name of the room in which each user's ICQ configuration
- * and contact lists will be stored.  (It's a personal room.)
- */
-#define ICQROOM                "My ICQ Config"
-
 /* MIME types to use for storing ICQ stuff */
 #define ICQMIME                "application/x-citadel-icq"     /* configuration */
 #define ICQCLMIME      "application/x-citadel-icq-cl"  /* contact list */
@@ -1794,7 +1788,7 @@ void CtdlICQ_Read_Config(void) {
        char icq_rm[ROOMNAMELEN];
        
        strcpy(hold_rm, CC->quickroom.QRname);
-       MailboxName(icq_rm, &CC->usersupp, ICQROOM);
+       MailboxName(icq_rm, &CC->usersupp, CONFIGROOM);
        strcpy(ThisICQ->icq_config, "");
 
        if (getroom(&CC->quickroom, icq_rm) != 0) {
@@ -1805,7 +1799,8 @@ void CtdlICQ_Read_Config(void) {
        /* We want the last (and probably only) config in this room */
        lprintf(9, "We're in <%s> looking for config\n", 
                CC->quickroom.QRname);
-       CtdlForEachMessage(MSGS_LAST, 1, ICQMIME, CtdlICQ_Read_Config_Backend);
+       CtdlForEachMessage(MSGS_LAST, 1, ICQMIME, NULL,
+               CtdlICQ_Read_Config_Backend);
        getroom(&CC->quickroom, hold_rm);
        return;
 }
@@ -1827,7 +1822,7 @@ void CtdlICQ_Write_Config(void) {
        fclose(fp);
 
        /* this handy API function does all the work for us */
-       CtdlWriteObject(ICQROOM, ICQMIME, temp, 1, 0, 1);
+       CtdlWriteObject(CONFIGROOM, ICQMIME, temp, &CC->usersupp, 0, 1, 0);
 
        unlink(temp);
 }
@@ -1857,7 +1852,7 @@ void CtdlICQ_Write_CL(void) {
        fclose(fp);
 
        /* this handy API function does all the work for us */
-       CtdlWriteObject(ICQROOM, ICQCLMIME, temp, 1, 0, 1);
+       CtdlWriteObject(CONFIGROOM, ICQCLMIME, temp, &CC->usersupp, 0, 1, 0);
 
        unlink(temp);
 }
@@ -1918,7 +1913,7 @@ void CtdlICQ_Read_CL(void) {
        char icq_rm[ROOMNAMELEN];
        
        strcpy(hold_rm, CC->quickroom.QRname);
-       MailboxName(icq_rm, &CC->usersupp, ICQROOM);
+       MailboxName(icq_rm, &CC->usersupp, CONFIGROOM);
        strcpy(ThisICQ->icq_config, "");
 
        if (getroom(&CC->quickroom, icq_rm) != 0) {
@@ -1933,7 +1928,8 @@ void CtdlICQ_Read_CL(void) {
        }
 
        /* We want the last (and probably only) list in this room */
-       CtdlForEachMessage(MSGS_LAST, 1, ICQCLMIME, CtdlICQ_Read_CL_Backend);
+       CtdlForEachMessage(MSGS_LAST, 1, ICQCLMIME, NULL,
+               CtdlICQ_Read_CL_Backend);
        getroom(&CC->quickroom, hold_rm);
 }
 
@@ -2308,7 +2304,7 @@ void CtdlICQ_UserOnline(DWORD uin, DWORD status, DWORD ip,
        
        CtdlICQ_Status_Update(uin, status);
        decoded_ip = ntohl(ip);
-       locate_host(CtdlICQ_CLent(uin)->host, &decoded_ip);
+       locate_host(CtdlICQ_CLent(uin)->host, (struct in_addr *)&decoded_ip);
 }