From b6938b71c266f458180103090af0ab72e3d9616c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 3 Sep 2010 13:23:44 -0400 Subject: [PATCH] Removed the USscreenwidth and USscreenheight fields. Everywhere. Since these were the last two 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 | 2 - citadel/include/dtds/user-defs.h | 2 - citadel/textclient/citadel.c | 8 --- citadel/textclient/routines.c | 116 +++++++++++++++++++------------ citadel/user_ops.c | 14 +--- citadel/utillib/citadel_ipc.c | 9 ++- 6 files changed, 80 insertions(+), 71 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index abcd3c42c..fee5ccead 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -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) */ }; diff --git a/citadel/include/dtds/user-defs.h b/citadel/include/dtds/user-defs.h index 0a9e9bda7..7adaad79b 100644 --- a/citadel/include/dtds/user-defs.h +++ b/citadel/include/dtds/user-defs.h @@ -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)*/ diff --git a/citadel/textclient/citadel.c b/citadel/textclient/citadel.c index 8d730855e..9f458f62c 100644 --- a/citadel/textclient/citadel.c +++ b/citadel/textclient/citadel.c @@ -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); diff --git a/citadel/textclient/routines.c b/citadel/textclient/routines.c index adca1fc1b..3c02792c0 100644 --- a/citadel/textclient/routines.c +++ b/citadel/textclient/routines.c @@ -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, "ext and 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 + ); } } diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 8b833a3cd..2f23c3875 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -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); } diff --git a/citadel/utillib/citadel_ipc.c b/citadel/utillib/citadel_ipc.c index 69a73116f..fb90f33d0 100644 --- a/citadel/utillib/citadel_ipc.c +++ b/citadel/utillib/citadel_ipc.c @@ -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); } -- 2.30.2