use an Enum for the cm_fields vector instead of nameless chars
[citadel.git] / citadel / modules / instmsg / serv_instmsg.c
index 040c1b42edef254d3b9c4b0fbc244336171eb594..cb4101a9744f79aac11cd0a87cb8d636e4550812 100644 (file)
@@ -5,18 +5,11 @@
  *
  * 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.
- * 
- * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * 
- * 
- * 
- *
  */
 #include "sysdep.h"
 #include <stdlib.h>
 #include "config.h"
 #include "msgbase.h"
 #include "user_ops.h"
-
-#ifndef HAVE_SNPRINTF
-#include "snprintf.h"
-#endif
-
 #include "ctdl_module.h"
 
 struct imlog {
@@ -471,16 +459,16 @@ void flush_individual_conversation(struct imlog *im) {
        msg->cm_anon_type = MES_NORMAL;
        msg->cm_format_type = FMT_RFC822;
        if (!IsEmptyStr(im->usernames[0])) {
-               msg->cm_fields['A'] = strdup(im->usernames[0]);
+               msg->cm_fields[eAuthor] = strdup(im->usernames[0]);
        } else {
-               msg->cm_fields['A'] = strdup("Citadel");
+               msg->cm_fields[eAuthor] = strdup("Citadel");
        }
        if (!IsEmptyStr(im->usernames[1])) {
-               msg->cm_fields['R'] = strdup(im->usernames[1]);
+               msg->cm_fields[eRecipient] = strdup(im->usernames[1]);
        }
-       msg->cm_fields['O'] = strdup(PAGELOGROOM);
-       msg->cm_fields['N'] = strdup(NODENAME);
-       msg->cm_fields['M'] = SmashStrBuf(&im->conversation);   /* we own this memory now */
+       msg->cm_fields[eOriginalRoom] = strdup(PAGELOGROOM);
+       msg->cm_fields[eNodeName] = strdup(NODENAME);
+       msg->cm_fields[eMesageText] = SmashStrBuf(&im->conversation);   /* we own this memory now */
 
        /* Start with usernums[1] because it's guaranteed to be higher than usernums[0],
         * so if there's only one party, usernums[0] will be zero but usernums[1] won't.