Skip to content
Open
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 @@ -63,6 +63,8 @@ public class MessagePanelHandler implements ThinletUiEventHandler, SingleGroupSe
private int numberToSend = 1;
/** The boolean stipulating whether the recipient field should be displayed */
private boolean shouldDisplayRecipientField;
/** The boolean stipulating whether the recipient field should be cleared after a message is sent*/
private boolean clearRecipientFieldOnSend;
/** The boolean stipulating whether we should check the length of the message (we don't in the auto-reply, for example) */
private boolean shouldCheckMaxMessageLength;
/** The number of recipients, used to estimate the cost of the message */
Expand All @@ -75,6 +77,7 @@ public class MessagePanelHandler implements ThinletUiEventHandler, SingleGroupSe
private MessagePanelHandler(UiGeneratorController uiController, boolean shouldDisplay, boolean shouldCheckMaxMessageLength, int numberOfRecipients) {
this.uiController = uiController;
this.shouldDisplayRecipientField = shouldDisplay;
this.clearRecipientFieldOnSend = true;
this.shouldCheckMaxMessageLength = shouldCheckMaxMessageLength;
this.numberOfRecipients = numberOfRecipients;
}
Expand Down Expand Up @@ -146,7 +149,9 @@ public void send() {

private void clearComponents() {
// We clear the components
uiController.setText(find(COMPONENT_TF_RECIPIENT), "");
if(clearRecipientFieldOnSend){
uiController.setText(find(COMPONENT_TF_RECIPIENT), "");
}
uiController.setText(find(COMPONENT_TF_MESSAGE), "");
uiController.setText(find(COMPONENT_LB_REMAINING_CHARS), String.valueOf(FrontlineMessage.SMS_LENGTH_LIMIT));
uiController.setText(find(COMPONENT_LB_MSG_NUMBER), "0");
Expand Down Expand Up @@ -362,6 +367,10 @@ public void updateCost() {

LOG.trace("EXIT");
}

public void setClearRecipientFieldOnSend(boolean clearRecipientFieldOnSend) {
this.clearRecipientFieldOnSend = clearRecipientFieldOnSend;
}

//> INSTANCE HELPER METHODS

Expand Down