AmendHub

jcs

/

subtext

/

amendments

/

423

sysop: Fix board saving


jcs made amendment 423 15 days ago
--- sysop.c Mon Mar 13 23:38:59 2023 +++ sysop.c Tue Mar 14 16:42:09 2023 @@ -77,15 +77,10 @@ sysop_menu(struct session *s) serial_init(); break; case 'i': - if (binkp_thread) { - session_printf(s, "Waking up binkp thread...\r\n"); - session_flush(s); - uthread_wakeup(binkp_thread); - } else { - session_printf(s, "No binkp thread, starting...\r\n"); - session_flush(s); - uthread_add(binkp_process, NULL); - } + session_printf(s, "Requesting binkp poll...\r\n"); + session_flush(s); + binkp_next_poll = 0; + uthread_wakeup(periodic_job_thread); break; case 'm': sysop_edit_motd(s); @@ -255,10 +250,11 @@ edit_board: db_cache_boards(db); break; case 0: - memcpy(&db->boards[n], new_board, sizeof(struct board)); + memcpy(&db->boards[bn - 1], new_board, + sizeof(struct board)); ret = bile_marshall_object(db->bile, board_object_fields, - nboard_object_fields, &db->boards[n], &data, &size); + nboard_object_fields, new_board, &data, &size); if (ret != 0 || size == 0) panic("board: failed to marshall object"); @@ -339,8 +335,6 @@ sysop_edit_folders(struct session *s) if (folder == NULL) continue; folder->id = bile_next_id(db->bile, DB_FOLDER_RTYPE); - folder->restricted_posting = false; - folder->restricted_viewing = false; ret = struct_editor(s, folder_fields, nfolder_fields, NULL, 0, folder, sizeof(struct folder), (void *)&new_folder, "New Folder", "Sysop:Folders:New");