sblendorio / petscii-bbs

A Java framework for building highly customizable PETSCII-enabled BBS, accessible from Commodore 64/128
Mozilla Public License 2.0
121 stars 16 forks source link

Reading the next message with a carriage return #40

Closed eightbitswide closed 4 years ago

eightbitswide commented 4 years ago

I've been slowly adapting a copy "UserLogon.Java" (originally used for the private Electronic Mail option) as a General Message area (new called "GeneralMessages.Java" for my own board. Most of my changes are formatting, and by creating the user "All" I've been able to make all messages visible to all users of the board.

I've been trying to add a feature which is eluding me for the last few weeks. When I user selects a message number to read, (example: 8) it displays the message as requested, then provides the option to [R]eply or any key to go back to the menu.

I'm hunting for a way for the user to hit [return] at the list of messages to display the next newest message (so if they read message 8, then it would now display message 7)

It appears that what I'm trying to add should go into:

    public void listMessages(boolean onlyUnread) throws Exception {
        List<Message> messages = getMessages("All", onlyUnread); 

perhaps after the section:


            } else if (isNumeric(cmd.replace("#", EMPTY)) && index>0 && index<=size) {
                displayMessage(messages.get(index - 1));

Not sure what I need to do to create this...