This could be a somewhat obscure issue, but here goes.
When replying to messages using Synchronet's "Scan for messages to you" feature, I've noticed that bbs.smb_curmsg seems to be relative to the messages to you rather than to the entire list of messages in the
sub-board. For instance, when reading the first message to you, bbs.smb_curmsg is 0, regardless of whether that message is the first
message in the sub-board or not.
I'd like to be able to get the current message number/index, like smb_curmsg, that is always relative to the entire list of messages, even when replying to messages using the "Scan for messages to you" feature.
Has anyone tried this and know if it's possible?
Have you tried using bbs.msg_offset or bbs.msg_number? You should be able to access an absolute message number via JavaScript using either of these property values.
Re: bbs.smb_curmsg in messages to you
By: Digital Man to Nightfox on Tue May 07 2013 01:26:19
Have you tried using bbs.msg_offset or bbs.msg_number? You should be able to access an absolute message number via JavaScript using either of these property values.
I'll try those.. Thanks.
The msg_offset is a 0-based offset into the index of all messages currently in the message area (sub-board). The msg_number is the 1-based unique number assigned to that message (and doesn't change when new messages are added or messages are deleted).
Re: bbs.smb_curmsg in messages to you
By: Digital Man to Nightfox on Wed May 08 2013 23:12:28
The msg_offset is a 0-based offset into the index of all messages currently in the message area (sub-board). The msg_number is the 1-based unique number assigned to that message (and doesn't change
when new messages are added or messages are deleted).
I've started examining the values of bbs.msg_offset and bbs.msg_number (using a "development" version of SlyEdit on my BBS). When I reply to a message, using the message read prompt, it seems that both bbs.msg_offset and bbs.msg_number are always 0, no matter which message I'm replying to.
It doesn't seem to matter which message group or sub-board I'm reading/replying in, either. Not sure if this is normal?
I've started examining the values of bbs.msg_offset and bbs.msg_number
(using a "development" version of SlyEdit on my BBS). When I reply to
a message, using the message read prompt, it seems that both
bbs.msg_offset and bbs.msg_number are always 0, no matter which
message I'm replying to. It doesn't seem to matter which message group
or sub-board I'm reading/replying in, either. Not sure if this is
normal?
It's as designed apparently, but unexpected. I'm making a change now in CVS which will allow those properties to be used in more places than just the "show message header" function (which doesn't directly use JavaScript) - that was an oversight on my part.
Re: bbs.smb_curmsg in messages to you
By: Digital Man to Nightfox on Sun May 12 2013 00:18:20
I've started examining the values of bbs.msg_offset and bbs.msg_number
(using a "development" version of SlyEdit on my BBS). When I reply to
a message, using the message read prompt, it seems that both
bbs.msg_offset and bbs.msg_number are always 0, no matter which
message I'm replying to. It doesn't seem to matter which message group
or sub-board I'm reading/replying in, either. Not sure if this is
normal?
It's as designed apparently, but unexpected. I'm making a change now
in CVS which will allow those properties to be used in more places
than just the "show message header" function (which doesn't directly use JavaScript) - that was an oversight on my part.
I updated to this morning's build, but I'm still seeing some odd behavior with bbs.msg_offset. I first read a few messages (using the message read prompt) and bbs.msg_offset was 0 for each message. Then I tried the "Scan for messages to you" in a different sub-board, and bbs.msg_offset had a non-zero value (which I imagine was correct for that situation). Then I came back to the first sub-board I was in and read messages again with the Message read prompt, and bbs.msg_offset was 2. The message I was reading was the last message in the sub-board, so that doesn't seem right.
What about the bbs.msg_number property? It behaving as you would expect?
Re: bbs.smb_curmsg in messages to you
By: Digital Man to Nightfox on Sun May 12 2013 13:44:16
What about the bbs.msg_number property? It behaving as you would expect?
I haven't tried using bbs.msg_number yet, but so far it seems to be
behaving as I would expect. But I'm a little hesitant to use it for MsgBase.get_msg_header(), since it doesn't change when new messages are added or deleted. SlyEdit (currently) uses message indexes, since I've always thought that was the most reliable way to reference a message.
I
remember a discussion a few months ago that I think involved using bbs.msg_number in a calculation to come up with an absolute message number, which wouldn't necessarily be for a message that exists.
Can
bbs.msg_number be used directly in MsgBase.get_msg_header (with the by_offset parameter as false)?
Can
bbs.msg_number be used directly in MsgBase.get_msg_header (with the
by_offset parameter as false)?
Yes, exactly.
The bbs.msg_offset property will probably just be removed since it doesn't provide any benefit.
Re: bbs.smb_curmsg in messages to you
By: Digital Man to Nightfox on Tue May 14 2013 17:53:28
Can
bbs.msg_number be used directly in MsgBase.get_msg_header (with the
by_offset parameter as false)?
Yes, exactly.
The bbs.msg_offset property will probably just be removed since it doesn't provide any benefit.
I've updated my development SlyEdit to use bbs.msg_number instead of bbs.msg_offset, and it indeed seems to get the correct message header even in cases where bbs.msg_offset didn't (such as when replying to messages during scanning for new messages to you). I'll release a new version of SlyEdit with this change.
I've updated my development SlyEdit to use bbs.msg_number instead of bbs.msg_offset, and it indeed seems to get the correct message header even in cases where bbs.msg_offset didn't (such as when replying to messages during scanning for new messages to you). I'll release a new version of SlyEdit with this change.
But you do know that bbs.msg_number property doesn't work with any version of Synchronet before the current development builds, right? Are you
handling that possibility (backwards compatibility) in your editor?
I've updated my development SlyEdit to use bbs.msg_number instead of bbs.msg_offset, and it indeed seems to get the correct message header even in cases where bbs.msg_offset didn't (such as when replying to messages during scanning for new messages to you). I'll release a
new version of SlyEdit with this change.
But you do know that bbs.msg_number property doesn't work with any version of Synchronet before the current development builds, right? Are you handling that possibility (backwards compatibility) in your editor?
But the Synchronet JavaScript documentation says bbs.msg_number was introduced in version 3.10: http://www.synchro.net/docs/jsobjs.html#bbs_properties
Is that not the case?
But the Synchronet JavaScript documentation says bbs.msg_number was
introduced in version 3.10:
It was, but as you reported, it didn't work. I fixed this on May 12th: http://cvs.synchro.net/commitlog.ssjs#29419
In all versions prior to that, it would contain 0 unless the script was running *while* the message was being displayed (which is unlikely).
Sysop: | Chris Crash |
---|---|
Location: | Huntington Beach, CA. |
Users: | 578 |
Nodes: | 8 (0 / 8) |
Uptime: | 28:51:40 |
Calls: | 10,736 |
Calls today: | 1 |
Files: | 5 |
Messages: | 443,184 |
Posted today: | 1 |