to be sent back to the client after a message is transmitted.
$Log$
+ Revision 630.10 2005/02/01 19:46:12 ajc
+ * Added an SMTP-like calling syntax to ENT0 to allow a confirmation message
+ to be sent back to the client after a message is transmitted.
+
Revision 630.9 2005/02/01 03:33:22 ajc
* Changed CtdlRoomAccess() calling syntax in order to return both
the access bits and the current view
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
/*
* Text description of this software
*/
-#define CITADEL "Citadel 6.30"
+#define CITADEL "Citadel 6.40"
/*
* REV_LEVEL is the current version number (multiplied by 100 to avoid having
* usually more strict because you're not really supposed to dump/load and
* upgrade at the same time.
*/
-#define REV_LEVEL 630 /* This version */
+#define REV_LEVEL 640 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
#define EXPORT_REV_MIN 626 /* Oldest compatible export files */
int err = 0;
struct recptypes *valid = NULL;
char subject[SIZ];
+ int do_confirm = 0;
+ long msgnum;
unbuffer_output();
anon_flag = extract_int(entargs, 2);
format_type = extract_int(entargs, 3);
extract(subject, entargs, 4);
+ do_confirm = extract_int(entargs, 6);
/* first check to make sure the request is valid. */
}
/* Read in the message from the client. */
- cprintf("%d send message\n", SEND_LISTING);
+ if (do_confirm) {
+ cprintf("%d send message\n", START_CHAT_MODE);
+ } else {
+ cprintf("%d send message\n", SEND_LISTING);
+ }
msg = CtdlMakeMessage(&CC->user, recp,
CC->room.QRname, anonymous, format_type,
masquerade_as, subject, NULL);
if (msg != NULL) {
- CtdlSubmitMsg(msg, valid, "");
+ msgnum = CtdlSubmitMsg(msg, valid, "");
+
+ if (do_confirm) {
+ cprintf("%ld\n", msgnum);
+ if (msgnum >= 0L) {
+ cprintf("Message accepted.\n");
+ }
+ else {
+ cprintf("Internal error.\n");
+ }
+ cprintf("000\n");
+ }
+
CtdlFreeMessage(msg);
}
CC->fake_postname[0] = '\0';
the message.
5 - Post name. When postflag is 2, this is the name you are posting as.
This is an Aide only command.
+ 6 - Do Confirmation. NOTE: this changes the protocol semantics! When
+you set this to nonzero, ENT0 will reply with a confirmation message after
+you submit the message text. The reply code for the ENT0 command will be
+START_CHAT_MODE instead of SEND_LISTING.
Possible result codes:
OK - The request is valid. (Client did not set the "post" flag, so the
having his/her mail forwarded, the forwarding address will be returned.
SEND_LISTING - The request is valid. The client should now transmit
the text of the message (ending with a 000 on a line by itself, as usual).
+ START_CHAT_MODE - The request is valid. The client should now transmit
+the text of the message, ending with a 000 on a line by itself. After
+transmitting the 000 terminator, the client MUST read in the confirmation
+from the server, which will also end with 000 on a line by itself. The format
+of the confirmation appears below.
ERROR + NOT_LOGGED_IN - Not logged in.
ERROR + HIGHER_ACCESS_REQUIRED - Higher access is required. An
explanation follows, worded in a form that can be displayed to the user.
ERROR + NO_SUCH_USER - The specified recipient does not exist.
+The format of the confirmation message, if requested, is as follows:
+Line 1: The new message number on the server for the message. It will be
+ positive for a real message number, or negative to denote
+ that an error occurred. If an error occurred, the message was
+ not saved.
+Line 2: A human-readable confirmation or error message.
+(More may be added to this in the future, so do not assume that there will
+only be two lines output. Keep reading until 000 is received.)
+
RINF (read Room INFormation file)