• Reading the scan_ptr for the 'mail sub'

    From Khelair@VERT/TINFOIL to All on Sat Mar 21 10:42:31 2015
    While implementing a new mail interface for my shell, it appears that I'm notãable to utilize the scan_ptr in the same way that I have been using in theãmessage base interface that I've done... There, I was utilizingãmsg_area.sub[bbs.cursub_code].whatever... Here, even when I specify manuallyãmsg_area.sub['mail'].scan_ptr, I still find it undefined. Can anybody tell meãif there is a different way to go about locating the current message/scan_ptrãin mail or should I get ready to toss up some code snippets?ã Any assistance or pointers in the right direction are appreciated.ãã -D/Kãã---ãBorg Burgers: We do it our way; your way is irrelevant.ã þ Synchronet þ Tinfoil Tetrahedron BBS telnet://tinfoil.synchro.netã
  • From Nightfox@VERT/DIGDIST to Khelair on Sun Mar 22 08:29:47 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Khelair to All on Sat Mar 21 2015 10:42:31ãã Kh> While implementing a new mail interface for my shell, it appears that I'mã Kh> not able to utilize the scan_ptr in the same way that I have been using inã Kh> the message base interface that I've done... There, I was utilizingã Kh> msg_area.sub[bbs.cursub_code].whatever... Here, even when I specifyã Kh> manually msg_area.sub['mail'].scan_ptr, I still find it undefined. Canã Kh> anybody tell me if there is a different way to go about locating theã Kh> current message/scan_ptr in mail or should I get ready to toss up someã Kh> code snippets? ããI've been working on a new message reader, and I've found that the msg_area,ãand it seems to me that the "mail" is a special case in that the msg_area.grp,ãmsg_ara.sub, etc. arrays don't seem to be defined for the "mail" area. Thoseãarrays seem to be only defined for the sub-boards. So, I don't think there isãa last-read pointer, etc. defined for the "mail" area. If you want to find theãlast read message for a user in the "mail" area, you'll need to go through allãmessages in the "mail" area, look for the ones written to the current logged-inãuser, and look at the 'attr' field in the message headers and find the last oneãthat has the MSG_READ attribute set. For example, something like this:ããvar msgbase = new MsgBase("mail");ãif (msgbase.is_open)ã{ã var lastReadMsgIdx = 0;ã for (var i = 0; i < msgbase.total_msgs; ++i)ã {ã var msgHdr = msgbase.get_msg_header(true, i, true);ã if ((msgHdr.to_ext == user.number) && ((msgHdr.attr & MSG_READ) ==ãMSG_READ))ã lastReadMsgIdx = i;ã }ã msgbase.close();ã}ãelseã console.print("Uh-oh, failed to open personal mail!\r\n\1p");ãããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
  • From Khelair@VERT/TINFOIL to Nightfox on Sun Mar 22 19:28:09 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Nightfox to Khelair on Sun Mar 22 2015 08:29:47ãã Ni> I've been working on a new message reader, and I've found that theã Ni> msg_area, and it seems to me that the "mail" is a special case in thatã Ni> the msg_area.grp, msg_ara.sub, etc. arrays don't seem to be defined forã Ni> the "mail" area. Those arrays seem to be only defined for theã Ni> sub-boards. So, I don't think there is a last-read pointer, etc.ã Ni> defined for the "mail" area. If you want to find the last read messageã Ni> for a user in the "mail" area, you'll need to go through all messages inã Ni> the "mail" area, look for the ones written to the current logged-inã Ni> user, and look at the 'attr' field in the message headers and find theã Ni> last one that has the MSG_READ attribute set. For example, somethingã[snip]ãã Wow. Well, not the answer that I was hoping for, but an excellent responseãfor information and solution. Much appreciated. :)ãã -D/Kãã---ãBorg Burgers: We do it our way; your way is irrelevant.ã þ Synchronet þ Tinfoil Tetrahedron BBS telnet://tinfoil.synchro.netã
  • From Digital Man@VERT to Khelair on Sun Mar 22 20:56:29 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Khelair to All on Sat Mar 21 2015 10:42 amãã > While implementing a new mail interface for my shell, it appears that I'mã > not able to utilize the scan_ptr in the same way that I have been using inã > the message base interface that I've done... There, I was utilizingã > msg_area.sub[bbs.cursub_code].whatever... Here, even when I specifyã > manually msg_area.sub['mail'].scan_ptr, I still find it undefined. Canã > anybody tell me if there is a different way to go about locating the currentã > message/scan_ptr in mail or should I get ready to toss up some codeã > snippets?ã > Any assistance or pointers in the right direction are appreciated.ããThere's no such concept of a 'new-scan pointer' for email. Instead, all mail ãwaiting for the current user is checked for the 'read' flag. If there is unread ãmail, that is when you typically tell the user they have "new mail", not based ãon any pointer value.ãã digital manããSynchronet "Real Fact" #13:ãSBBSecho was originally written by Allen Christiansen (King Drafus) in 1994.ãNorco, CA WX: 58.7øF, 80.0% humidity, 6 mph SE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Digital Man@VERT to Nightfox on Sun Mar 22 20:57:58 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Nightfox to Khelair on Sun Mar 22 2015 08:29 amãã > Re: Reading the scan_ptr for the 'mail sub'ã > By: Khelair to All on Sat Mar 21 2015 10:42:31ã >ã > Kh> While implementing a new mail interface for my shell, it appears thatã > Kh> I'm not able to utilize the scan_ptr in the same way that I have beenã > Kh> using in the message base interface that I've done... There, I wasã > Kh> utilizing msg_area.sub[bbs.cursub_code].whatever... Here, even when Iã > Kh> specify manually msg_area.sub['mail'].scan_ptr, I still find itã > Kh> undefined. Can anybody tell me if there is a different way to go aboutã > Kh> locating the current message/scan_ptr in mail or should I get ready toã > Kh> toss up some code snippets?ã >ã > I've been working on a new message reader, and I've found that the msg_area,ã > and it seems to me that the "mail" is a special case in that theã > msg_area.grp, msg_ara.sub, etc. arrays don't seem to be defined for theã > "mail" area. Those arrays seem to be only defined for the sub-boards. So,ã > I don't think there is a last-read pointer, etc. defined for the "mail"ã > area. If you want to find the last read message for a user in the "mail"ã > area, you'll need to go through all messages in the "mail" area, look forã > the ones written to the current logged-in user, and look at the 'attr' fieldã > in the message headers and find the last one that has the MSG_READ attributeã > set. For example, something like this:ã >ã > var msgbase = new MsgBase("mail");ã > if (msgbase.is_open)ã > {ã > var lastReadMsgIdx = 0;ã > for (var i = 0; i < msgbase.total_msgs; ++i)ã > {ã > var msgHdr = msgbase.get_msg_header(true, i, true);ã > if ((msgHdr.to_ext == user.number) && ((msgHdr.attr & MSG_READ) ==ã > MSG_READ))ã > lastReadMsgIdx = i;ã > }ã > msgbase.close();ã > }ã > elseã > console.print("Uh-oh, failed to open personal mail!\r\n\1p");ããUsers can read their mail out-of-order, so the concept of "lastReadMsgIdx" ãdoesn't really apply here.ãã digital manããSynchronet "Real Fact" #62:ã"Baja" (name of Synchronet PCMS compiler/languege) is pronounced "ba-ha".ãNorco, CA WX: 58.7øF, 80.0% humidity, 6 mph SE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Nightfox@VERT/DIGDIST to Digital Man on Mon Mar 23 19:34:52 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Digital Man to Nightfox on Sun Mar 22 2015 20:57:58ãã DM> Users can read their mail out-of-order, so the concept of "lastReadMsgIdx"ã DM> doesn't really apply here.ããUsers can read messages on sub-boards out of order too though.. The messageãread prompt lets users enter a message number and it will jump directly to ãthat message. A user could jump around messages in a sub-board that way.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
  • From Digital Man@VERT to Nightfox on Mon Mar 23 20:11:26 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Nightfox to Digital Man on Mon Mar 23 2015 07:34 pmãã > Re: Reading the scan_ptr for the 'mail sub'ã > By: Digital Man to Nightfox on Sun Mar 22 2015 20:57:58ã >ã > DM> Users can read their mail out-of-order, so the concept ofã > DM> "lastReadMsgIdx" doesn't really apply here.ã >ã > Users can read messages on sub-boards out of order too though.. The messageã > read prompt lets users enter a message number and it will jump directly toã > that message. A user could jump around messages in a sub-board that way.ããRight, but we don't store a separate "message read" flag for every message for ãevery user. That's why we use a single "highest message number read" pointer ãfor each user for each sub-board. Email uses a different method.ãã digital manããSynchronet "Real Fact" #39:ãSynchronet has been ported to FreeBSD, NetBSD, OpenBSD, Solaris, QNX, and MacOS.ãNorco, CA WX: 61.9øF, 64.0% humidity, 6 mph ESE wind, 0.00 inches rain/24hrsã---ã þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.netã
  • From Nightfox@VERT/DIGDIST to Digital Man on Mon Mar 23 21:35:06 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Digital Man to Nightfox on Mon Mar 23 2015 20:11:26ãã > DM>> Users can read their mail out-of-order, so the concept ofã > DM>> "lastReadMsgIdx" doesn't really apply here.ãã >> Users can read messages on sub-boards out of order too though.. Theã >> message read prompt lets users enter a message number and it will jumpã >> directly to that message. A user could jump around messages in aã >> sub-board that way. ãã DM> Right, but we don't store a separate "message read" flag for every messageã DM> for every user. That's why we use a single "highest message number read"ã DM> pointer for each user for each sub-board. Email uses a different method.ããI see what you're saying. Conceptually, they seem different but also slightlyãsimilar. For personal email, if you want to point the user to the first unreadãmessage (similar to a newscan in a sub-board), you could iterate throughãpersonal messages to the user, starting with the first, and look for the firstãmessage that doesn't have the "message read" flag set. The user could readãtheir messages out of order, but that would still get them to an unreadãpersonal email. I think that's what Khelair was going for.ããNightfoxãã---ã þ Synchronet þ Digital Distortion BBS - digitaldistortionbbs.comã
  • From Khelair@VERT/TINFOIL to Digital Man on Mon Mar 23 21:10:52 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Digital Man to Khelair on Sun Mar 22 2015 20:56:29ãã DM> There's no such concept of a 'new-scan pointer' for email. Instead, allã DM> mail waiting for the current user is checked for the 'read' flag. Ifã DM> there is unread mail, that is when you typically tell the user they haveã DM> "new mail", not based on any pointer value.ãã Roger that. Got some helpful code from [I believe it was, please shoot me ifãI'm wrong] Nightfox that I implemented with little change. :)ã Now I just need to go back and rewrite some of my modularized code a bit soãthat I can re-use the existing routines and not my bastardized reinvention ofãthe wheel I already wrote with the other message bases, since everything isãpretty much the same in the interface I'm writing...ãã -D/Kãã---ãBorg Burgers: We do it our way; your way is irrelevant.ã þ Synchronet þ Tinfoil Tetrahedron BBS telnet://tinfoil.synchro.netã
  • From Khelair@VERT/TINFOIL to Nightfox on Tue Mar 24 19:34:54 2015
    Re: Reading the scan_ptr for the 'mail sub'ã By: Nightfox to Digital Man on Mon Mar 23 2015 21:35:06ãã Ni> slightly similar. For personal email, if you want to point the user toã Ni> the first unread message (similar to a newscan in a sub-board), you couldã Ni> iterate through personal messages to the user, starting with the first,ã Ni> and look for the first message that doesn't have the "message read" flagã Ni> set. The user could read their messages out of order, but that would stillã Ni> get them to an unread personal email. I think that's what Khelair wasã Ni> going for.ãã Aye, this is the behavior that I'm looking for. The interface that I'mãimplementing (see bbs.eschwa.com if you want an example) is very minimal, andãhandles everything by first unread on forward. That is the starting point,ãanyway, as you mentioned... After that you can go forward, backward, or jumpãto any particular message, yes. It's a very, very linear interface, whereãbasically you can scroll through the whole system from email to message boardsãby doing nothing other than thwapping the spacebar at the end of each one.ãã -D/Kãã---ãBorg Burgers: We do it our way; your way is irrelevant.ã þ Synchronet þ Tinfoil Tetrahedron BBS telnet://tinfoil.synchro.netã