]> code.citadel.org Git - citadel.git/commitdiff
* Implement alternate_semantics (see comments in citadel.rc file)
authorMichael Hampton <io_error@uncensored.citadel.org>
Tue, 15 Jan 2002 12:41:53 +0000 (12:41 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Tue, 15 Jan 2002 12:41:53 +0000 (12:41 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/citadel_decls.h
citadel/commands.c
citadel/messages.c
citadel/routines2.c

index 688d25d9b109f541b0a7969858dff0f4d3aa5197..b189fe31535ea0d8c45b7fe714d32798eafcb11b 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 590.64  2002/01/15 12:41:53  error
+ * Implement alternate_semantics (see comments in citadel.rc file)
+
  Revision 590.63  2002/01/15 11:07:51  ajc
  * vcard.c: updated vCard "object methods" to handle multiple instances of
    the same key name when necessary.
@@ -3163,3 +3166,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
 
+
index 6845b46123fc7c470013f3833f3d9a430da0a5d6..c9de2c8716aa230921381f607c2cef2fb96f5b38 100644 (file)
@@ -991,19 +991,20 @@ int main(int argc, char **argv)
 
        get_serv_info(telnet_client_host);
 
-       if (!starttls()) {
-               printf("Session will not be encrypted.\n");
-       }
-       
        look_for_ansi();
        cls(0);
        color(7);
 
+       if (!starttls()) {
+               printf("Session will not be encrypted.\n");
+       }
+
        printf("%-24s\n%s\n%s\n", serv_info.serv_software, serv_info.serv_humannode,
-              serv_info.serv_bbs_city);
+               serv_info.serv_bbs_city);
+
        screenwidth = 80;       /* default screen dimensions */
        screenheight = 24;
-
+       
        printf(" pause    next    stop\n");
        printf(" ctrl-s  ctrl-o  ctrl-c\n\n");
        formout("hello");       /* print the opening greeting */
@@ -1237,16 +1238,26 @@ PWOK:
                                gotonext();
                                break;
                        case 47:
-                               updatelsa();
+                               if (!rc_alt_semantics)
+                                       updatelsa();
                                gotonext();
                                break;
+                       case 90:
+                               if (!rc_alt_semantics)
+                                       updatelsa();
+                               dotgoto(argbuf, 0);
+                               break;
                        case 58:
                                updatelsa();
                                dotgoto("_MAIL_", 1);
                                break;
                        case 20:
                                updatels();
+                               dotgoto(argbuf, 0);
+                               break;
                        case 52:
+                               if (rc_alt_semantics)
+                                       updatelsa();
                                dotgoto(argbuf, 0);
                                break;
                        case 10:
@@ -1338,11 +1349,13 @@ PWOK:
                                validate();
                                break;
                        case 29:
-                               updatels();
+                               if (!rc_alt_semantics)
+                                       updatels();
                                termn8 = 1;
                                break;
                        case 30:
-                               updatels();
+                               if (!rc_alt_semantics)
+                                       updatels();
                                termn8 = 1;
                                break;
                        case 48:
@@ -1463,6 +1476,8 @@ PWOK:
                                break;
 
                        case 6:
+                               if (rc_alt_semantics)
+                                       updatelsa();
                                gotonext();
                                break;
 
index dc3d6a06e66bfe4544b1f9b890fc08b06c22a2f7..8f8478bfd9e20015b0e4a0f383ef6b81566e7b4d 100644 (file)
@@ -96,6 +96,30 @@ remember_passwords=0
 #urlcmd=netscape -remote "openURL(%s)"
 
 
+# MESSAGE READING SEMANTICS (experimental)
+#
+# A new set of message reading semantics is now available.  If you set
+# alternate_semantics, the following changes are made:
+#
+# * Messages are marked as read when you read them, rather than when you
+#   leave the room.  This means read <N>ew will display a new message
+#   at most once, unless last old on new is turned on.
+# * Reading <F>orward or <R>everse does not mark messages as read.
+# * When you leave a room with <G>oto, <J>ump, etc., only messages that
+#   were in the room when you arrived are marked as read.  The original
+#   semantics mark all messages read that were in the room at the time
+#   you leave the room.  This occasionally causes messages to be "lost."
+# * When you leave with <T>erminate, no additional messages are marked
+#   as read.
+# * The <S>kip and <A>bandon commands are reversed.
+#
+# This set of semantics should make Citadel easier to use on very busy
+# systems, where many messages may be posted while reading.  Users
+# accustomed to D.O.C. or its variants will want to set this option.
+#
+alternate_semantics=no
+
+
 # COMMAND SET CONFIGURATION
 #
 # All lines starting with "cmd=" are considered to be commands.  This allows
@@ -153,6 +177,7 @@ cmd=15,0,&Terminate
 cmd=16,0,&Ungoto
 cmd=17,0,&Who is online
 cmd=47,0,&Abandon ^r^c goto...
+#cmd=90,0,&Abandon ^r^c goto:
 cmd=50,0,toggle e&Xpert mode
 cmd=49,0,read &Info file
 cmd=18,2,&! <shell>
index e2b97bc67c817b7679d6bb8cdd5faa0938fb6944..6a63a3c643fb6d23cf45bfb139fb4cddccdc8587 100644 (file)
@@ -15,6 +15,7 @@ extern char rc_password[32];
 extern char rc_floor_mode;
 extern char rc_encrypt;                        /* from the citadel.rc file */
 extern char arg_encrypt;               /* from the command line */
+extern char rc_alt_semantics;
 extern char express_msgs;
 void logoff(int code);
 void formout(char *name);
index c56bdd6ba9f622c40f57481824f9e63c60836fc6..95fa992c9cb1160dc33d8f99da6643610c2a7860 100644 (file)
@@ -690,6 +690,7 @@ void load_command_set(void)
        rc_ansi_color = 0;
        strcpy(rc_url_cmd, "");
        rc_encrypt = RC_DEFAULT;
+       rc_alt_semantics = 0;
 
        /* now try to open the citadel.rc file */
 
@@ -777,6 +778,12 @@ void load_command_set(void)
                if (!strncasecmp(buf, "urlcmd=", 7))
                        strcpy(rc_url_cmd, &buf[7]);
 
+               if (!strncasecmp(buf, "alternate_semantics=", 20)) {
+                       if (!strncasecmp(&buf[11], "yes", 3))
+                               rc_alt_semantics = 1;
+                       if (!strncasecmp(&buf[11], "no", 2))
+                               rc_alt_semantics = 0;
+               }
                if (!strncasecmp(buf, "cmd=", 4)) {
                        strcpy(buf, &buf[4]);
 
index 0aae4e715ad323484f81dc93c1dab70b5e6e9335..d18b2307fcd616de12afc2d249486ddc973a2e16 100644 (file)
@@ -63,6 +63,7 @@ void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd);
 char reply_to[512];
 long msg_arr[MAXMSGS];
 int num_msgs;
+char rc_alt_semantics;
 extern char room_name[];
 extern unsigned room_flags;
 extern long highest_msg_read;
@@ -1123,6 +1124,7 @@ void readmsgs(
        }
 
        if (num_msgs == 0) {
+               if (c == 3) return;
                printf("*** There are no ");
                if (c == 1) printf("new ");
                if (c == 2) printf("old ");
@@ -1191,6 +1193,13 @@ RMSGREAD:        fflush(stdout);
                                } while ((g != f) && (g >= 0));
                        printf("Message printed.\n");
                }
+               if (rc_alt_semantics && c == 1) {
+                       char buf[SIZ];
+
+                       snprintf(buf, sizeof(buf), "SEEN %ld", msg_arr[a]);
+                       serv_puts(buf);
+                       serv_gets(buf); /* Don't need to check this? */
+               }
                if (e == 3)
                        return;
                if (((userflags & US_NOPROMPT) || (e == 2))
index 4eeff192498bf439131ffeffd98336e922cff066..77b03c7150d0c6ed6530f86064f6ffab3f1de1ca 100644 (file)
@@ -166,7 +166,19 @@ void entregis(void)
 void updatels(void)
 {                              /* make all messages old in current room */
        char buf[SIZ];
-       serv_puts("SLRP HIGHEST");
+
+       if (rc_alt_semantics) {
+               if (maxmsgnum == highest_msg_read == 0) {
+                       /* fprintf(stderr, "maxmsgnum == highest_msg_read == 0\n"); */
+                       return;
+               }
+               snprintf(buf, sizeof(buf), "SLRP %ld",
+                               (maxmsgnum > highest_msg_read) ?
+                                maxmsgnum : highest_msg_read);
+               serv_puts(buf);
+       } else {
+               serv_puts("SLRP HIGHEST");
+       }
        serv_gets(buf);
        if (buf[0] != '2')
                printf("%s\n", &buf[4]);
@@ -178,6 +190,7 @@ void updatels(void)
 void updatelsa(void)
 {
        char buf[SIZ];
+
        sprintf(buf, "SLRP %ld", highest_msg_read);
        serv_puts(buf);
        serv_gets(buf);