/* If this isn't a MIME message, don't bother. */
if (msg->cm_format_type != 4) return(0);
- /* If there's no EUID we can't do this. */
- if (msg->cm_fields['E'] == NULL) return(0);
+ /* If there's no EUID we can't do this. Reject the post. */
+ if (msg->cm_fields['E'] == NULL) return(1);
+
snprintf(history_page, sizeof history_page, "%s_HISTORY_", msg->cm_fields['E']);
/* Make sure we're saving a real wiki page rather than a wiki history page.
msg->cm_fields['U'] = strdup(msg->cm_fields['E']);
/* See if we can retrieve the previous version. */
- old_msgnum = locate_message_by_euid(msg->cm_fields['E'], &CCC->room);
+ old_msgnum = CtdlLocateMessageByEuid(msg->cm_fields['E'], &CCC->room);
if (old_msgnum > 0L) {
old_msg = CtdlFetchMessage(old_msgnum, 1);
}
/* Now look for the existing edit history */
- history_msgnum = locate_message_by_euid(history_page, &CCC->room);
+ history_msgnum = CtdlLocateMessageByEuid(history_page, &CCC->room);
history_msg = NULL;
if (history_msgnum > 0L) {
history_msg = CtdlFetchMessage(history_msgnum, 1);
}
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
- msgnum = locate_message_by_euid(history_page_name, &CC->room);
+ msgnum = CtdlLocateMessageByEuid(history_page_name, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
/* Begin by fetching the current version of the page. We're going to patch
* backwards through the diffs until we get the one we want.
*/
- msgnum = locate_message_by_euid(pagename, &CC->room);
+ msgnum = CtdlLocateMessageByEuid(pagename, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
/* Get the revision history */
snprintf(history_page_name, sizeof history_page_name, "%s_HISTORY_", pagename);
- msgnum = locate_message_by_euid(history_page_name, &CC->room);
+ msgnum = CtdlLocateMessageByEuid(history_page_name, &CC->room);
if (msgnum > 0L) {
msg = CtdlFetchMessage(msgnum, 1);
}
int screenheight;
unsigned room_flags;
unsigned room_flags2;
+int entmsg_ok = 0;
char room_name[ROOMNAMELEN];
char *uglist[UGLISTLEN]; /* size of the ungoto list */
long uglistlsn[UGLISTLEN]; /* current read position for all the ungoto's. Not going to make any friends with this one. */
from_floor = curr_floor;
curr_floor = room->RRfloor;
+ /* Determine, based on the room's default view, whether an <E>nter message
+ * command will be valid here.
+ */
+ switch(room->RRdefaultview) {
+ case VIEW_BBS:
+ case VIEW_MAILBOX:
+ entmsg_ok = 1;
+ break;
+ default:
+ entmsg_ok = 0;
+ break;
+ }
+
remove_march(room_name, 0);
if (!strcasecmp(towhere, "_BASEROOM_"))
remove_march(towhere, 0);
rret[0]->RRaide = extract_int(cret, 8);
rret[0]->RRnewmail = extract_long(cret, 9);
rret[0]->RRfloor = extract_int(cret, 10);
+ rret[0]->RRcurrentview = extract_int(cret, 11);
+ rret[0]->RRdefaultview = extract_int(cret, 12);
+ /* position 13 is a trash folder flag ... irrelevant in this client */
rret[0]->RRflags2 = extract_int(cret, 14);
} else {
free(*rret);