*
* 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 {
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]);
+ CM_SetField(msg, eAuthor, im->usernames[0], strlen(im->usernames[0]));
} else {
- msg->cm_fields['A'] = strdup("Citadel");
+ CM_SetField(msg, eAuthor, HKEY("Citadel"));
}
if (!IsEmptyStr(im->usernames[1])) {
- msg->cm_fields['R'] = strdup(im->usernames[1]);
+ CM_SetField(msg, eRecipient, im->usernames[1], strlen(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 */
+
+ CM_SetField(msg, eOriginalRoom, HKEY(PAGELOGROOM));
+ CM_SetField(msg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetAsFieldSB(msg, eMesageText, &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.
snprintf(roomname, sizeof roomname, "%010ld.%s", im->usernums[1], PAGELOGROOM);
CtdlCreateRoom(roomname, 5, "", 0, 1, 1, VIEW_BBS);
msgnum = CtdlSubmitMsg(msg, NULL, roomname, 0);
- CtdlFreeMessage(msg);
+ CM_Free(msg);
/* If there is a valid user number in usernums[0], save a copy for them too. */
if (im->usernums[0] > 0) {