stable now but there are GIANT PIECES MISSING
[citadel.git] / citadel / modules / migrate / serv_migrate.c
index 7c62d34652754747a03a03ab6e433f6e67965d1e..33b566361e7ba387f59bb79bbe8725cc80c4e7e2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This module dumps and/or loads the Citadel database in XML format.
  *
- * Copyright (c) 1987-2019 by the citadel.org team
+ * Copyright (c) 1987-2020 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 3.
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <ctype.h>
@@ -135,6 +124,9 @@ void migr_export_users_backend(char *username, void *data) {
        client_write(HKEY("<u_fullname>"));     xml_strout(u.fullname);         client_write(HKEY("</u_fullname>\n"));
        cprintf("<u_msgnum_bio>%ld</u_msgnum_bio>\n", u.msgnum_bio);
        cprintf("<u_msgnum_pic>%ld</u_msgnum_pic>\n", u.msgnum_pic);
+       cprintf("<u_emailaddrs>%s</u_emailaddrs>\n", u.emailaddrs);
+       cprintf("<u_msgnum_inboxrules>%ld</u_msgnum_inboxrules>\n", u.msgnum_inboxrules);
+       cprintf("<u_lastproc_inboxrules>%ld</u_lastproc_inboxrules>\n", u.lastproc_inboxrules);
        client_write(HKEY("</user>\n"));
 }
 
@@ -326,7 +318,7 @@ void migr_export_message(long msgnum) {
 
        /* Ok, here we go ... */
 
-       msg = CtdlFetchMessage(msgnum, 1, 0);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) return;        /* fail silently */
 
        client_write(HKEY("<message>\n"));
@@ -586,6 +578,9 @@ int migr_userrecord(void *data, const char *el)
        else if (!strcasecmp(el, "u_fullname"))                 safestrncpy(usbuf.fullname, ChrPtr(migr_chardata), sizeof usbuf.fullname);
        else if (!strcasecmp(el, "u_msgnum_bio"))               usbuf.msgnum_bio = atol(ChrPtr(migr_chardata));
        else if (!strcasecmp(el, "u_msgnum_pic"))               usbuf.msgnum_pic = atol(ChrPtr(migr_chardata));
+       else if (!strcasecmp(el, "u_emailaddrs"))               safestrncpy(usbuf.emailaddrs, ChrPtr(migr_chardata), sizeof usbuf.emailaddrs);
+       else if (!strcasecmp(el, "u_msgnum_inboxrules"))        usbuf.msgnum_inboxrules = atol(ChrPtr(migr_chardata));
+       else if (!strcasecmp(el, "u_lastproc_inboxrules"))      usbuf.lastproc_inboxrules = atol(ChrPtr(migr_chardata));
        else return 0;
        return 1;
 }
@@ -945,7 +940,7 @@ int migr_restore_message_metadata(long msgnum, int refcount)
 
        /* Ok, here we go ... */
 
-       msg = CtdlFetchMessage(msgnum, 1, 0);
+       msg = CtdlFetchMessage(msgnum, 1);
        if (msg == NULL) {
                return 1;
        }