Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message list to a session after adding a new message to the list #114

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ public Messages put(Message message)
if (messages == null)
{
messages = new CopyOnWriteArrayList<>();
session.putObject(SO_MESSAGE_QUEUE, messages);
}

// As a failsafe, do not store a large number of messages.
if (messages.size() < MAXIMUM_MESSAGE_COUNT)
{
messages.add(message);
session.putObject(SO_MESSAGE_QUEUE, messages);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,24 @@ public class Message
/**
* The message to display to the user
*/
private final String message;
private String message;

/**
* The type of message
*/
private final MessageType type;

/**
* A default constructor for using by serializers.
*/
public Message()
{
super();
this.id = null;
this.type = MessageType.NORMAL;
addClass(this.type.getClassName());
}

/**
* Create a new message to be displayed to the user. The type of the
* message will be NORMAL and it will have a CSS class of normal.
Expand Down