refactor naming of core message manipulation funcions
[citadel.git] / citadel / modules / inetcfg / serv_inetcfg.c
index e3be75c801641d6414c46d362524b1e856a49c63..7c0bedaa10aaf1cd89604a9c463b09f6c71b8e7f 100644 (file)
@@ -66,8 +66,8 @@ void inetcfg_setTo(struct CtdlMessage *msg) {
        char *conf;
        char buf[SIZ];
        
-       if (msg->cm_fields['M']==NULL) return;
-       conf = strdup(msg->cm_fields['M']);
+       if (CM_IsEmpty(msg, eMesageText)) return;
+       conf = strdup(msg->cm_fields[eMesageText]);
 
        if (conf != NULL) {
                do {
@@ -92,10 +92,10 @@ int inetcfg_aftersave(struct CtdlMessage *msg) {
        /* If this isn't the configuration room, or if this isn't a MIME
         * message, don't bother.
         */
-       if (strcasecmp(msg->cm_fields['O'], SYSCONFIGROOM)) return(0);
+       if (strcasecmp(msg->cm_fields[eOriginalRoom], SYSCONFIGROOM)) return(0);
        if (msg->cm_format_type != 4) return(0);
 
-       ptr = msg->cm_fields['M'];
+       ptr = msg->cm_fields[eMesageText];
        while (ptr != NULL) {
        
                linelen = strcspn(ptr, "\n");
@@ -122,7 +122,7 @@ void inetcfg_init_backend(long msgnum, void *userdata) {
                msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {
                inetcfg_setTo(msg);
-                       CtdlFreeMessage(msg);
+                       CM_Free(msg);
        }
 }