Removed the USscreenwidth and USscreenheight fields. Everywhere. Since these were...
authorArt Cancro <ajc@citadel.org>
Fri, 3 Sep 2010 17:23:44 +0000 (13:23 -0400)
committerArt Cancro <ajc@citadel.org>
Fri, 3 Sep 2010 17:23:44 +0000 (13:23 -0400)
fields in the ctdluser data structure, we are able to simply remove them instead of replacing them
with placeholders.  cmd_getu() now returns 80x24 all the time, and cmd_setu() now ignores the
supplied screen dimensions.

citadel/citadel.h
citadel/include/dtds/user-defs.h
citadel/textclient/citadel.c
citadel/textclient/routines.c
citadel/user_ops.c
citadel/utillib/citadel_ipc.c

index abcd3c42c1c1a4ba5a40f6d10feca68f6b606273..fee5ccead551d0fc291ae8fd2bb79dbbaa9da26a 100644 (file)
@@ -151,8 +151,6 @@ struct ctdluser {                   /* User record                      */
        time_t lastcall;                /* Date/time of most recent login    */
        int USuserpurge;                /* Purge time (in days) for user     */
        char fullname[64];              /* Display name (primary identifier) */
-       cit_uint8_t USscreenwidth;      /* Screen width (for textmode users) */
-       cit_uint8_t USscreenheight;     /* Screen height(for textmode users) */
 };
 
 
index 0a9e9bda7a17706f497a2ca94ceb43bee9aa5ec7..7adaad79b6cc476adbc6265500b0d876c5eb0081 100644 (file)
@@ -11,5 +11,3 @@ LONG(usernum);                        /* User number (never recycled)     */
 TIME(lastcall);                /* Last time the user called        */
 INTEGER(USuserpurge);          /* Purge time (in days) for user    */
 STRING_BUF(fullname,64);               /* Name for Citadel messages & mail */
-UINT8(USscreenwidth);  /* Screen width (for textmode users)*/
-UINT8(USscreenheight); /* Screen height(for textmode users)*/
index 8d730855eda712dea9079c2ef6a00c8d07f6acfb..9f458f62c3a313ab534154f2ec5cf4f704c3e30b 100644 (file)
@@ -973,8 +973,6 @@ void read_config(CtdlIPC *ipc)
        scr_printf("\n");
 
        /* show preferences */
-       scr_printf("Your screen width: ");                                     color(BRIGHT_CYAN); scr_printf("%d",   /*user->USscreenwidth*/ screenwidth);          color(DIM_WHITE); 
-       scr_printf(", height: ");                                              color(BRIGHT_CYAN); scr_printf("%d\n", /*user->USscreenheight*/ screenheight);        color(DIM_WHITE);  
        scr_printf("Are you an experienced Citadel user: ");                   color(BRIGHT_CYAN); scr_printf("%s\n", (user->flags & US_EXPERT) ? "Yes" : "No");     color(DIM_WHITE);
        scr_printf("Print last old message on New message request: ");         color(BRIGHT_CYAN); scr_printf("%s\n", (user->flags & US_LASTOLD)? "Yes" : "No");     color(DIM_WHITE);
        scr_printf("Prompt after each message: ");                             color(BRIGHT_CYAN); scr_printf("%s\n", (!(user->flags & US_NOPROMPT))? "Yes" : "No"); color(DIM_WHITE);
@@ -1782,17 +1780,11 @@ NEWUSR: if (IsEmptyStr(rc_password)) {
        screenwidth = 80;
        screenheight = 24;
        r = CtdlIPCGetConfig(ipc, &myself, aaa);
-       if (r == 2) {
-               screenwidth = myself->USscreenwidth;
-               screenheight = myself->USscreenheight;
-       }
        if (getenv("TERM") != NULL)
                if (!strcmp(getenv("TERM"), "xterm")) {
                        have_xterm = 1;
                }
-#ifdef TIOCGWINSZ
        check_screen_dims();
-#endif
 
        set_floor_mode(ipc);
 
index adca1fc1b5face6b1d2ad61b63c1ce78bab83087..3c02792c0a66ca1852f542a4221b776f45c6cf18 100644 (file)
@@ -226,17 +226,6 @@ void enter_config(CtdlIPC *ipc, int mode)
 
        if (mode == 0 || mode == 1) {
 
-               /* Does anyone still use dialup connections with manual
-                * screen dimensions setting anymore?  For now we'll keep
-                * the system's ability to set these, but remove the prompts
-                * because they're spurious for nearly everyone.
-                * 
-               user->USscreenwidth = intprompt("Enter your screen width",
-                                               user->USscreenwidth, 20, 255);
-               user->USscreenheight = intprompt("Enter your screen height",
-                                                user->USscreenheight, 3, 255);
-                */
                user->flags = set_attr(ipc, user->flags,
                                       "Are you an experienced Citadel user",
                                       US_EXPERT, 0);
@@ -245,49 +234,90 @@ void enter_config(CtdlIPC *ipc, int mode)
                        return;
                }
 
-               user->flags = set_attr(ipc, user->flags,
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
                        "Print last old message on New message request",
-                       US_LASTOLD, 0);
-
-               user->flags = set_attr(ipc, user->flags,
-                                      "Prompt after each message",
-                                      US_NOPROMPT, 1);
-
-               if ((user->flags & US_NOPROMPT) == 0)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "Use 'disappearing' prompts",
-                                              US_DISAPPEAR, 0);
-
-               user->flags = set_attr(ipc, user->flags,
-                                      "Pause after each screenful of text",
-                                      US_PAGINATOR, 0);
+                       US_LASTOLD,
+                       0
+               );
+
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Prompt after each message",
+                       US_NOPROMPT,
+                       1
+               );
+
+               if ((user->flags & US_NOPROMPT) == 0) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "Use 'disappearing' prompts",
+                               US_DISAPPEAR,
+                               0
+                       );
+               }
 
-               if (rc_prompt_control == 3 && (user->flags & US_PAGINATOR))
-                       user->flags = set_attr(ipc, user->flags,
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Pause after each screenful of text",
+                       US_PAGINATOR,
+                       0
+               );
+
+               if (rc_prompt_control == 3 && (user->flags & US_PAGINATOR)) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
                                "<N>ext and <S>top work at paginator prompt",
-                               US_PROMPTCTL, 0);
+                               US_PROMPTCTL,
+                               0
+                       );
+               }
 
-               if (rc_floor_mode == RC_DEFAULT)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "View rooms by floor",
-                                              US_FLOORS, 0);
+               if (rc_floor_mode == RC_DEFAULT) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "View rooms by floor",
+                               US_FLOORS,
+                               0
+                       );
+               }
 
-               if (rc_ansi_color == 3)
-                       user->flags = set_attr(ipc, user->flags,
-                                              "Enable color support",
-                                              US_COLOR, 0);
+               if (rc_ansi_color == 3) {
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
+                               "Enable color support",
+                               US_COLOR,
+                               0
+                       );
+               }
 
-               if ((user->flags & US_EXPERT) == 0)
+               if ((user->flags & US_EXPERT) == 0) {
                        formout(ipc, "unlisted");
+               }
 
-               user->flags = set_attr(ipc, user->flags,
-                                      "Be unlisted in userlog",
-                                      US_UNLISTED, 0);
+               user->flags = set_attr(
+                       ipc,
+                       user->flags,
+                       "Be unlisted in userlog",
+                       US_UNLISTED,
+                       0
+               );
 
                if (!IsEmptyStr(editor_paths[0])) {
-                       user->flags = set_attr(ipc, user->flags,
+                       user->flags = set_attr(
+                               ipc,
+                               user->flags,
                                "Always enter messages with the full-screen editor",
-                               US_EXTEDIT, 0);
+                               US_EXTEDIT,
+                               0
+                       );
                }
 
        }
index 8b833a3cdd8d7b58974d152735114462be304073..2f23c3875cc6e710acd8c0ae4247f68bd5961a2b 100644 (file)
@@ -1106,8 +1106,6 @@ int internal_create_user (const char *username, long len, struct ctdluser *usbuf
        usbuf->timescalled = 0;
        usbuf->posted = 0;
        usbuf->axlevel = config.c_initax;
-       usbuf->USscreenwidth = 80;
-       usbuf->USscreenheight = 24;
        usbuf->lastcall = time(NULL);
 
        /* fetch a new user number */
@@ -1412,12 +1410,10 @@ void cmd_getu(char *cmdbuf)
                return;
 
        CtdlGetUser(&CC->user, CC->curr_user);
-       cprintf("%d %d|%d|%d|\n",
+       cprintf("%d 80|24|%d|\n",
                CIT_OK,
-               CC->user.USscreenwidth,
-               CC->user.USscreenheight,
                (CC->user.flags & US_USER_SET)
-           );
+       );
 }
 
 /*
@@ -1433,12 +1429,8 @@ void cmd_setu(char *new_parms)
                return;
        }
        CtdlGetUserLock(&CC->user, CC->curr_user);
-       CC->user.USscreenwidth = extract_int(new_parms, 0);
-       CC->user.USscreenheight = extract_int(new_parms, 1);
        CC->user.flags = CC->user.flags & (~US_USER_SET);
-       CC->user.flags = CC->user.flags |
-           (extract_int(new_parms, 2) & US_USER_SET);
-
+       CC->user.flags = CC->user.flags | (extract_int(new_parms, 2) & US_USER_SET);
        CtdlPutUserLock(&CC->user);
        cprintf("%d Ok\n", CIT_OK);
 }
index 69a73116f376f683c1f0b787c3442a39c853a691..fb90f33d0c80f69966e62c8c2efc3588ba2c67a5 100644 (file)
@@ -363,8 +363,6 @@ int CtdlIPCGetConfig(CtdlIPC *ipc, struct ctdluser **uret, char *cret)
 
        ret = CtdlIPCGenericCommand(ipc, "GETU", NULL, 0, NULL, NULL, cret);
        if (ret / 100 == 2) {
-               uret[0]->USscreenwidth = extract_int(cret, 0);
-               uret[0]->USscreenheight = extract_int(cret, 1);
                uret[0]->flags = extract_int(cret, 2);
        }
        return ret;
@@ -379,9 +377,10 @@ int CtdlIPCSetConfig(CtdlIPC *ipc, struct ctdluser *uret, char *cret)
        if (!uret) return -2;
        if (!cret) return -2;
 
-       sprintf(aaa, "SETU %d|%d|%d",
-                       uret->USscreenwidth, uret->USscreenheight,
-                       uret->flags);
+       sprintf(aaa,
+               "SETU 80|24|%d",
+               uret->flags
+       );
        return CtdlIPCGenericCommand(ipc, aaa, NULL, 0, NULL, NULL, cret);
 }