Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commits (2)
  • Rob Swindell's avatar
    New @-codes SEX and GENDERS · 0e270c4e
    Rob Swindell authored
    SEX is the user's sex/gender
    GENDERS is the list of system-supported genders for new users to choose from.
    0e270c4e
  • Rob Swindell's avatar
    New @-code: !x to perform Ctrl-A style terminal/attribute control · 87731220
    Rob Swindell authored
    Most Ctrl-A code terminal/attribute effects can now be invoked via @!x@ where x is one or more Ctrl-A sequence operands (e.g. @!B@ to set the current attribute to blue, @!P@ to pause the terminal). Multiple attribute codes may be specified in a single @!x@ sequence. Both upper and lowercase attribute codes are supported. The "^A@" sequence is not supported, but there's already an @-code to perform the equivalent operation ("SHOW:20").
    
    Rationale: when using PabloDraw to edit display (e.g. .msg) files, there was no easy way to explicitly clear (set to "normal") the current attributes at the end of a line of text. If that line of text contained a background color and the line caused the terminal to scroll, that background color would fill the next/new line resulting in some potential undesirable effects. There are 2 common solutions to this problem: either clear the screen before displaying the file (not always desirable) or clear the attributes at the end of the line (before the CR/LF). This can now be achieved by adding a @!N@ (the equivalent of Ctrl-AN for "normal" attributes) to the end of a line. There's no way to insert custom Ctrl-A sequences or other way to force PabloDraw to clear the attributes at the end of a line, that I found.
    
    I chose the '!' character because it's (on my keyboard anyway) the Shift-1 key and Ctrl-A is ASCII 1. I considered a sequence such as @A:x@, but that's one more character and since this sequence usually won't display anything, a shorter sequence is likely preferred. For the shortest-possible sequence, use Ctrl-A sequences instead. However, for many consecutive Ctrl-A sequences, the @-code equivalent might actually end up being shorter(!). @-codes aren't support in as many places in Synchronet where Ctrl-A codes are supported (for security reasons), so it's not like this is going to replace the use of Ctrl-A codes everywhere.
    87731220
...@@ -120,6 +120,13 @@ int sbbs_t::show_atcode(const char *instr, JSObject* obj) ...@@ -120,6 +120,13 @@ int sbbs_t::show_atcode(const char *instr, JSObject* obj)
return len; return len;
} }
// @!x@ for Ctrl-A x equivalent(s) */
if(*sp == '!') {
for(p = sp + 1; *p != '\0' && *p != '@'; p++)
ctrl_a(*p);
return len;
}
disp_len=len; disp_len=len;
if((p = strchr(sp, '|')) != NULL) { if((p = strchr(sp, '|')) != NULL) {
if(strchr(p, 'T') != NULL) if(strchr(p, 'T') != NULL)
...@@ -540,6 +547,14 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool ...@@ -540,6 +547,14 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen, long* pmode, bool
if(strcmp(sp, "TMP") == 0) if(strcmp(sp, "TMP") == 0)
return useron.tmpext; return useron.tmpext;
if(strcmp(sp, "SEX") == 0) {
safe_snprintf(str, maxlen, "%c", useron.sex);
return str;
}
if(strcmp(sp, "GENDERS") == 0) {
return cfg.new_genders;
}
if(!strcmp(sp,"QWKID")) if(!strcmp(sp,"QWKID"))
return(cfg.sys_id); return(cfg.sys_id);
......