diff --git a/ansis_default/mainmenu.ans b/ansis_default/mainmenu.ans index b46bc4b..76613de 100644 Binary files a/ansis_default/mainmenu.ans and b/ansis_default/mainmenu.ans differ diff --git a/bbs.h b/bbs.h index efec9ca..b9fd7fa 100644 --- a/bbs.h +++ b/bbs.h @@ -247,6 +247,8 @@ extern struct user_record *new_user(); extern struct user_record *check_user_pass(char *loginname, char *password); extern void list_users(struct user_record *user); +extern void active_nodes(); +extern void send_node_msg(); extern void display_bulletins(); extern void display_textfiles(); diff --git a/magicka.strings b/magicka.strings index b8bb909..98b5dd1 100644 --- a/magicka.strings +++ b/magicka.strings @@ -214,3 +214,8 @@ Sorry, this %s is unavailable over SSH\r\n \e[0;36mO. \e[1;37mDefault Protocol (\e[1;33m%s\e[1;37m)\r\n File exists!\r\n \e[0;36mM. \e[1;37mShow Node Msgs (\e[1;33m%s\e[1;37m)\r\n +Node %d. %s\r\n +Select a node to message...\r\n\r\n +\r\nInvalid Node!\r\n +\r\nEnter your message (256 chars max)...\r\n +%s on node %d says:\r\n %s\r\n\r\n diff --git a/main_menu.c b/main_menu.c index d3343c5..ff9efcb 100644 --- a/main_menu.c +++ b/main_menu.c @@ -9,6 +9,8 @@ #include "lua/lauxlib.h" extern struct bbs_config conf; +extern struct user_record *gUser; +extern int mynode; void display_bulletins() { int i; @@ -28,6 +30,61 @@ void display_bulletins() { } } +void active_nodes() { + int i; + struct stat s; + char buffer[PATH_MAX]; + FILE *fptr; + + for (i=0;i conf.nodes) { + s_printf(get_string(218)); + return; + } + s_printf(get_string(219)); + + s_readstring(msg, 256); + + snprintf(buffer, PATH_MAX, "%s/node%d", conf.bbs_path, nodetomsg); + + if (stat(buffer, &s) != 0) { + mkdir(buffer, 0755); + } + snprintf(buffer, PATH_MAX, "%s/node%d/nodemsg.txt", conf.bbs_path, nodetomsg); + + fptr = fopen(buffer, "a"); + if (fptr) { + fprintf(fptr, get_string(220), gUser->loginname, mynode, msg); + fclose(fptr); + } +} + void display_textfiles() { int i; char buffer[5]; diff --git a/menus.c b/menus.c index 1df2005..3e85002 100644 --- a/menus.c +++ b/menus.c @@ -44,6 +44,7 @@ #define MENU_PREVFILESUB 35 #define MENU_LISTMESSAGES 36 #define MENU_DOSCRIPT 37 +#define MENU_SENDNODEMSG 38 extern struct bbs_config conf; extern struct user_record *gUser; @@ -181,6 +182,8 @@ int menu_system(char *menufile) { menu[menu_items-1]->command = MENU_LISTMESSAGES; } else if (strncasecmp(&buffer[8], "DOSCRIPT", 8) == 0) { menu[menu_items-1]->command = MENU_DOSCRIPT; + } else if (strncasecmp(&buffer[8], "SENDNODEMSG", 11) == 0) { + menu[menu_items-1]->command = MENU_SENDNODEMSG; } } else if (strncasecmp(buffer, "SECLEVEL", 8) == 0) { menu[menu_items-1]->seclevel = atoi(&buffer[9]); @@ -451,7 +454,10 @@ int menu_system(char *menufile) { break; case MENU_DOSCRIPT: do_lua_script(menu[i]->data); - break; + break; + case MENU_SENDNODEMSG: + send_node_msg(); + break; } break; } diff --git a/menus_default/main.mnu b/menus_default/main.mnu index aa93710..cda75ff 100644 --- a/menus_default/main.mnu +++ b/menus_default/main.mnu @@ -37,6 +37,9 @@ DATA file HOTKEY S COMMAND SETTINGS +HOTKEY N +COMMAND SENDNODEMSG + HOTKEY G COMMAND SUBMENU DATA logoff