Updated the CtdlUserGoto() API call to also return the oldest and newest message...
[citadel.git] / citadel / modules / imap / imap_misc.c
index be0fa51edd252a523f78ad2271c69cd9c3d2d8a8..5b501e4e7aba575f2018fef4b04715115a1e0306 100644 (file)
@@ -52,6 +52,7 @@
 #include "user_ops.h"
 #include "database.h"
 #include "msgbase.h"
+#include "room_ops.h"
 #include "internet_addressing.h"
 #include "serv_imap.h"
 #include "imap_tools.h"
@@ -373,7 +374,7 @@ void imap_append(int num_parms, ConstStr *Params) {
        if (Imap->selected) {
                strcpy(savedroom, CCC->room.QRname);
        }
-       CtdlUserGoto(roomname, 0, 0, &msgs, &new);
+       CtdlUserGoto(roomname, 0, 0, &msgs, &new, NULL, NULL);
 
        /* If the user is locally authenticated, FORCE the From: header to
         * show up as the real sender.  FIXME do we really want to do this?
@@ -386,8 +387,8 @@ void imap_append(int num_parms, ConstStr *Params) {
           if ( ((CCC->room.QRflags & QR_MAILBOX) == 0) && (config.c_imap_keep_from == 0)) {
 
                CM_SetField(msg, eAuthor, CCC->user.fullname, strlen(CCC->user.fullname));
-               CM_SetField(msg, eNodeName, config.c_nodename, strlen(config.c_nodename));
-               CM_SetField(msg, eHumanNode, config.c_humannode, strlen(config.c_humannode));
+               CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+               CM_SetField(msg, eHumanNode, CFG_KEY(c_humannode));
            }
        }
 
@@ -423,11 +424,11 @@ void imap_append(int num_parms, ConstStr *Params) {
         * our happy day without violent explosions.
         */
        if (Imap->selected) {
-               CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
+               CtdlUserGoto(savedroom, 0, 0, &msgs, &new, NULL, NULL);
        }
 
        /* We don't need this buffer anymore */
-       CtdlFreeMessage(msg);
+       CM_Free(msg);
 
        if (new_message_flags != NULL) {
                imap_do_append_flags(new_msgnum, new_message_flags);