Closed FreeScholar closed 6 years ago
Found this code in Room.java
String sMessage;
// AUTOSCROLL MESSAGES and MANUAL PUBLIC MESSAGES
// PUBLIC_MESSAGE_VAR has the public message from manual
// and either the public or privat message in autoscroll
// depending on if they hit the speak or the whisper button
if(((sMessage = lt.getValue(PUBLIC_MESSAGE_VAR)) != null) && !sMessage.equals(""))
if(lt.getValue(PRIVATE_CHECKBOX_VAR) == null)
send(new Message(sMessage, c.HashKey(), (String)null, Message.PUBLIC));
else {
Message m = c.privateMessage(sMessage);
if(m != null)
UserRegistry.sendMessage(m);
}
// MANUAL PUBLIC MESSAGES
if(((sMessage = lt.getValue(PRIVATE_MESSAGE_VAR)) != null) &&
!sMessage.equals("")) {
Message m = c.privateMessage(sMessage);
if(m != null) {
UserRegistry.sendMessage(m);
}
}
}
autoscroll.java has some things in it that may be interesting...
Tested as regular user, not admin in the realtime chat, not using the 'speak or whisper buttons', just the enter key.
Given user is logged into chatroom in the realtime chat mode (not necessarily as the admin) Then user types a message in the text input and hits the enter key on their keyboard Then their username is posted in the chat window And their message is not posted - just a blank space under their username When user posts a second message Then the users first message is posted, but the second message is not posted
When a user types a message into the input and posts by hitting enter on keyboard, the cursor is not focused to return to the input box and you have to click in the box to re-focus the cursor before typing next message. This was working.
The Public messages are now posting normally
In the real time chat interface, the public messages do not appear in the chat window. Private messages appear if you check PM next to a chatters handle/name.