]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_icq.c
* Get/save arbitrary configs
[citadel.git] / citadel / serv_icq.c
index 9a05a94b36842057cd276d20a628b799cf9f7d29..0af084e111e5f597f10964e651e1c25737e4fb30 100644 (file)
@@ -33,9 +33,6 @@
 #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"
@@ -55,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 */
@@ -1796,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, USERCONFIGROOM);
        strcpy(ThisICQ->icq_config, "");
 
        if (getroom(&CC->quickroom, icq_rm) != 0) {
@@ -1807,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;
 }
@@ -1829,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(USERCONFIGROOM, ICQMIME, temp, &CC->usersupp, 0, 1, 0);
 
        unlink(temp);
 }
@@ -1859,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(USERCONFIGROOM, ICQCLMIME, temp, &CC->usersupp, 0, 1, 0);
 
        unlink(temp);
 }
@@ -1920,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, USERCONFIGROOM);
        strcpy(ThisICQ->icq_config, "");
 
        if (getroom(&CC->quickroom, icq_rm) != 0) {
@@ -1935,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);
 }