Monday, November 08, 2010 at 12:00 AM.
scripting2Suite.data.code.realtime.server.initInbox
on initInbox (username, ipaddress) {
<<Changes
<<7/20/10; 6:27:52 AM by DW
<<On initUser call, allow it to create a new user table, because we've already validated the username and password.
<<7/19/10; 9:57:34 AM by DW
<<Created.
local (adruser = realtime.server.initUser (username, true), now = clock.now ());
local (adrinbox = @adruser^.inboxes.[ipaddress]);
if not defined (adrinbox^) {
new (tabletype, adrinbox)};
if not defined (adrinbox^.queue) {
new (tabletype, @adrinbox^.queue)};
bundle { //stats
if not defined (adrinbox^.stats) {
new (tabletype, @adrinbox^.stats)};
if not defined (adrinbox^.stats.ctPushes) {
adrinbox^.stats.ctPushes = 0};
if not defined (adrinbox^.stats.ctChecks) {
adrinbox^.stats.ctChecks = 0};
if not defined (adrinbox^.stats.ctTimeouts) {
adrinbox^.stats.ctTimeouts = 0};
if not defined (adrinbox^.stats.ctNonTimeouts) {
adrinbox^.stats.ctNonTimeouts = 0};
if not defined (adrinbox^.stats.ctLoops) {
adrinbox^.stats.ctLoops = 0};
if not defined (adrinbox^.stats.whenCreated) {
adrinbox^.stats.whenCreated = now};
if not defined (adrinbox^.stats.whenLastCheck) {
adrinbox^.stats.whenLastCheck = date (0)}};
return (adrinbox)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.