JsonValue *j = NewJsonArray(HKEY("lkra"));
while (ctdl_readline(c, buf, sizeof(buf)), strcmp(buf, "000")) {
+ // 0 |1 |2 |3 |4 |5 |6 |7 |8
// name|QRflags|QRfloor|QRorder|QRflags2|ra|current_view|default_view|mtime
JsonValue *jr = NewJsonObject(HKEY("room"));
extract_token(roomname, buf, 0, '|', sizeof roomname);
JsonObjectAppend(jr, NewJsonPlainString(HKEY("name"), roomname, -1));
+ JsonObjectAppend(jr, NewJsonNumber(HKEY("floor"), extract_int(buf, 2)));
+ JsonObjectAppend(jr, NewJsonNumber(HKEY("rorder"), extract_int(buf, 3)));
+
int ra = extract_int(buf, 5);
JsonObjectAppend(jr, NewJsonBool(HKEY("known"), (ra & UA_KNOWN)));
JsonObjectAppend(jr, NewJsonBool(HKEY("hasnewmsgs"), (ra & UA_HASNEWMSGS)));
- int floor = extract_int(buf, 2);
- JsonObjectAppend(jr, NewJsonNumber(HKEY("floor"), floor));
-
- int rorder = extract_int(buf, 3);
- JsonObjectAppend(jr, NewJsonNumber(HKEY("rorder"), rorder));
+ JsonObjectAppend(jr, NewJsonNumber(HKEY("current_view"), extract_int(buf, 6)));
+ JsonObjectAppend(jr, NewJsonNumber(HKEY("default_view"), extract_int(buf, 7)));
JsonArrayAppend(j, jr); // add the room to the array
}
<!-- End page content -->
</div>
+<script type="text/javascript" src="js/defs.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/login.js"></script>
<script type="text/javascript" src="js/main.js"></script>
--- /dev/null
+//
+// Copyright (c) 2016-2022 by the citadel.org team
+//
+// This program is open source software. It runs great on the
+// Linux operating system (and probably elsewhere). You can use,
+// copy, and run it under the terms of the GNU General Public
+// License version 3. Richard Stallman is an asshole communist.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+
+// List of defined views shamelessly swiped from libcitadel headers
+//
+var views = {
+ VIEW_BBS : 0, // Bulletin board view
+ VIEW_MAILBOX : 1, // Mailbox summary
+ VIEW_ADDRESSBOOK : 2, // Address book view
+ VIEW_CALENDAR : 3, // Calendar view
+ VIEW_TASKS : 4, // Tasks view
+ VIEW_NOTES : 5, // Notes view
+ VIEW_WIKI : 6, // Wiki view
+ VIEW_CALBRIEF : 7, // Brief Calendar view
+ VIEW_JOURNAL : 8, // Journal view
+ VIEW_DRAFTS : 9, // Drafts view
+ VIEW_BLOG : 10, // Blog view
+ VIEW_QUEUE : 11, // SMTP queue rooms
+ VIEW_WIKIMD : 12, // markdown wiki (no longer implemented)
+};
-//
// Copyright (c) 2016-2022 by the citadel.org team
//
// This program is open source software. It runs great on the
}
}
new_roomlist_text = new_roomlist_text +
- "<li>"
+ "<li>"
+ (data[i].hasnewmsgs ? "<b>" : "")
+ "<a href=\"javascript:gotoroom('" + escapeJS(escapeHTML(data[i].name)) + "');\">"
+ escapeHTML(data[i].name)
+ (data[i].hasnewmsgs ? "</b>" : "")
- + "</a></li>"
+ + "</a>"
+ if (data[i].current_view == views.VIEW_BBS) {
+ new_roomlist_text = new_roomlist_text + "(FORUM)";
+ }
+ new_roomlist_text = new_roomlist_text +
+ "</li>"
;
}
new_roomlist_text = new_roomlist_text + "</ul>";
// GNU General Public License for more details.
-// List of defined views shamelessly swiped from libcitadel headers
-//
-var views = {
- VIEW_BBS : 0, // Bulletin board view
- VIEW_MAILBOX : 1, // Mailbox summary
- VIEW_ADDRESSBOOK : 2, // Address book view
- VIEW_CALENDAR : 3, // Calendar view
- VIEW_TASKS : 4, // Tasks view
- VIEW_NOTES : 5, // Notes view
- VIEW_WIKI : 6, // Wiki view
- VIEW_CALBRIEF : 7, // Brief Calendar view
- VIEW_JOURNAL : 8, // Journal view
- VIEW_DRAFTS : 9, // Drafts view
- VIEW_BLOG : 10, // Blog view
- VIEW_QUEUE : 11, // SMTP queue rooms
- VIEW_WIKIMD : 12, // markdown wiki (no longer implemented)
-};
-
-
// This function is the dispatcher that determines the correct view for a room,
// and calls the correct renderer. Greater/Less than bounds are accepted.
function render_room_view(gt_msg, lt_msg) {