TIP: Click on subject to list as thread! ANSI
echo: synchronet
to: Digital Man
from: deon
date: 2022-05-09 11:42:00
subject: MsgBase first_msg propert

  Re: MsgBase first_msg property.
  By: Digital Man to deon on Sun May 08 2022 05:17 pm

 >  >  > I've added a proper caching of the last-read 'first_msg' value (caching it in the object's private data). I'll commit that now. Give it a try and let me know if it does what you were hoping for.
 >
 >  > Thanks, I was going for what you were doing but couldnt figure out how first_msg would default to zero if the attribute was read and the msgbase hadnt been opened yet. How are you getting that?
 >
 > This line zeroes-out the index structure (where the first message number is taken):
 >         memset(&idx,0,sizeof(idx));
 >
 > If the call to smb_getfirstidx() fails, then the idx is just left as is (all zeroed-out).
 >

Thanks, yes I saw that. But it's only called if the msgbase is opened.

What if

x = new MsgBase(code);
JSON.stringify(x);

It still shows first_msg is zero (as is last_msg) - which I know is what it should be - I couldnt follow how that was achieved for "first_msg" (I see how it is done for the other attributes). Or was that pure luck, and it could potentially be anything?

It doesnt impact what I'm doing, just learning c++ code, one idea at a time :)


...лоеп

---
 ю Synchronet ю Alterant | an SBBS in Docker on Pi!
                                                                                                 
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.