-function gotoroom_2(data) {
- current_room = data.name;
- new_messages = data.new_messages;
- total_messages = data.total_messages;
- current_view = data.current_view;
- default_view = data.default_view;
- last_seen = data.last_seen;
- update_banner();
- render_room_view(0, Number.MAX_VALUE);
+
+
+// Called by gotonext() when the march list is empty.
+//
+function load_new_march_list() {
+ fetchm = async() => {
+ response = await fetch("/ctdl/r/");
+ march_list = await(response.json());
+ if (response.ok) {
+ march_list = march_list.filter(function(room) {
+ return room.hasnewmsgs;
+ });
+ march_list = march_list.sort(function(a,b) {
+ if (a.floor != b.floor) {
+ return(a.floor - b.floor);
+ }
+ if (a.rorder != b.rorder) {
+ return(a.rorder - b.rorder);
+ }
+ return(a.name < b.name);
+ });
+ march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
+ gotonext();
+ }
+ }
+ fetchm();