From 6becb03ef8185789918873a3c2cf25d2f745438c Mon Sep 17 00:00:00 2001 From: deuce <> Date: Thu, 5 Nov 2009 06:07:00 +0000 Subject: [PATCH] Mail is *not* subnum -1, it's subnum 0xffff (INVALID_SUB) which, since subnum is uint32_t, is 65535. --- src/sbbs3/js_msgbase.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sbbs3/js_msgbase.c b/src/sbbs3/js_msgbase.c index c83ae60690..fdbf5ce844 100644 --- a/src/sbbs3/js_msgbase.c +++ b/src/sbbs3/js_msgbase.c @@ -587,8 +587,9 @@ js_get_msg_index(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *r memset(&msg,0,sizeof(msg)); for(n=0;n<argc;n++) { - if(JSVAL_IS_BOOLEAN(argv[n])) + if(JSVAL_IS_BOOLEAN(argv[n])) { by_offset=JSVAL_TO_BOOLEAN(argv[n]); + } else if(JSVAL_IS_NUM(argv[n])) { if(by_offset) /* Get by offset */ JS_ValueToInt32(cx,argv[n],(int32*)&msg.offset); @@ -1701,7 +1702,7 @@ static char* msgbase_prop_desc[] = { ,"maximum number of messages before expiration - <small>READ ONLY</small>" ,"maximum age (in days) of messages to store - <small>READ ONLY</small>" ,"message base attributes - <small>READ ONLY</small>" - ,"sub-board number (0-based, -1 for e-mail) - <small>READ ONLY</small>" + ,"sub-board number (0-based, 65535 for e-mail) - <small>READ ONLY</small>" ,"<i>true</i> if the message base has been opened successfully - <small>READ ONLY</small>" ,NULL }; -- GitLab