-// Forum view -- let's have another go at this with the rendering done client-side
-//
-function forum_readmessages(flat_or_threads)
-{
- var innerdivname = randomString(5);
- document.getElementById("main").innerHTML = "<div id=\"" + innerdivname +
- "\"><br><br><br><center><h5><i class=\"fas fa-spinner fa-spin\"></i> "
- + _("Loading messages from server, please wait") + "</h5></center></div>" ;
+ if (msgs.length == 0)
+ {
+ document.getElementById(innerdivname).innerHTML += "FIXME no msgs" ;
+ }
+
+ // If we were given an explicit starting point, by all means start there.
+ // Note that we don't have to remove them from the array because we did a 'msgs gt|xxx' command to Citadel.
+ else if (min_msg > 0)
+ {
+ msgs = msgs.slice(0, msgs_per_page);
+ }
+
+ // show us the last 20 messages and scroll to the bottom (this will become the not-logged-in behavior)
+ else if ((logged_in) | (!logged_in))
+ {
+ if (msgs.length > messages_per_page)
+ {
+ msgs = msgs.slice(msgs.length - messages_per_page);
+ document.getElementById(innerdivname).innerHTML += "<div id=\"older_msgs\">link to msgs less than " + msgs[0] + "</div>" ;
+ }
+ }