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

Commit 0ad2c4a2 authored by rswindell's avatar rswindell

Define and use sbbs_t::msghdr_tos (exposed via JS as

console.msghdr_top_of_screen):
a hack to let scripts know whether the most-recently displayed message header
was displayed on the top of the terminal screen (or not). This allows us to
show avatars at the top of the screen when the header is up there, rather than
relevative to the bottom of the header (the pos can vary, depending on stuff).
parent e858d895
......@@ -137,6 +137,7 @@ void sbbs_t::show_msghdr(smb_t* smb, smbmsg_t* msg)
else
CRLF;
}
msghdr_tos = tos;
if(!menu("msghdr", P_NOERROR)) {
bprintf(text[MsgSubj],msg->subj);
if(msg->tags && *msg->tags)
......
......@@ -145,6 +145,8 @@ enum {
,BBS_PROP_MSG_REPLY_ID
,BBS_PROP_MSG_DELIVERY_ATTEMPTS
,BBS_PROP_MSGHDR_TOS
/* READ ONLY */
,BBS_PROP_BATCH_UPLOAD_TOTAL
,BBS_PROP_BATCH_DNLOAD_TOTAL
......@@ -268,6 +270,8 @@ enum {
,"message replied-to identifier"
,"message delivery attempt counter"
,"message header displayed at top-of-screen"
,"file name"
,"file description"
,"file directory (number)"
......@@ -691,6 +695,9 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
else
p=sbbs->current_msg->reply_id;
break;
case BBS_PROP_MSGHDR_TOS:
val = sbbs->msghdr_tos;
break;
/* Currently Displayed File (sbbs.current_file) */
case BBS_PROP_FILE_NAME:
......@@ -1082,6 +1089,8 @@ static jsSyncPropertySpec js_bbs_properties[] = {
{ "msg_delivery_attempts" ,BBS_PROP_MSG_DELIVERY_ATTEMPTS
,PROP_READONLY ,310},
{ "msghdr_top_of_screen" ,BBS_PROP_MSGHDR_TOS ,PROP_READONLY ,31702},
{ "file_name" ,BBS_PROP_FILE_NAME ,PROP_READONLY ,317},
{ "file_description" ,BBS_PROP_FILE_DESC ,PROP_READONLY ,317},
{ "file_dir_number" ,BBS_PROP_FILE_DIR ,PROP_READONLY ,317},
......
......@@ -234,7 +234,7 @@ static JSBool js_console_set(JSContext *cx, JSObject *obj, jsid id, JSBool stric
JS_RESUMEREQUEST(cx, rc);
break;
case CON_PROP_TOS:
sbbs->tos=val;
sbbs->tos = val ? true : false;
break;
case CON_PROP_ROWS:
if(val >= TERM_ROWS_MIN && val <= TERM_ROWS_MAX)
......
......@@ -3403,8 +3403,10 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
telnet_ack_event=CreateEvent(NULL, /* Manual Reset: */FALSE,/* InitialState */FALSE,NULL);
listInit(&savedlines, /* flags: */0);
sys_status=lncntr=criterrs=0L;
tos = false;
msghdr_tos = false;
listInit(&smb_list, /* flags: */0);
sys_status=lncntr=tos=criterrs=0L;
column=0;
tabstop=8;
lastlinelen=0;
......
......@@ -467,7 +467,8 @@ public:
uchar attr_stack[64]; /* Saved attributes (stack) */
int attr_sp; /* Attribute stack pointer */
long lncntr; /* Line Counter - for PAUSE */
long tos; /* Top of Screen */
bool tos; /* Cursor is currently at the Top of Screen */
bool msghdr_tos; /* Message header was displayed at Top of Screen */
long rows; /* Current number of Rows for User */
long cols; /* Current number of Columns for User */
long column; /* Current column counter (for line counter) */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment