// only save anonymous usernames
frostSettings.setValue(SettingsClass.LAST_USED_FROMNAME, from);
}
frostSettings.setValue("userName."+board.getBoardFilename(), from);
final FrostUnsentMessageObject newMessage = new FrostUnsentMessageObject();
newMessage.setMessageId(Mixed.createUniqueId()); // new message, create a new unique msg id
newMessage.setInReplyTo(repliedMsgId);
newMessage.setBoard(board);
newMessage.setFromName(from);
newMessage.setSubject(subject);
newMessage.setContent(text);
newMessage.setIdLinePos(idLinePos);
newMessage.setIdLineLen(idLineLen);
// MessageUploadThread will set date + time !
// attach all files and boards the user chosed
if( filesTableModel.getRowCount() > 0 ) {
for(int x=0; x < filesTableModel.getRowCount(); x++) {
final MFAttachedFile af = (MFAttachedFile)filesTableModel.getRow(x);
final File aChosedFile = af.getFile();
final FileAttachment fa = new FileAttachment(aChosedFile);
newMessage.addAttachment(fa);
}
newMessage.setHasFileAttachments(true);
}
if( boardsTableModel.getRowCount() > 0 ) {
for(int x=0; x < boardsTableModel.getRowCount(); x++) {
final MFAttachedBoard ab = (MFAttachedBoard)boardsTableModel.getRow(x);
final Board aChosedBoard = ab.getBoardObject();
final BoardAttachment ba = new BoardAttachment(aChosedBoard);
newMessage.addAttachment(ba);
}
newMessage.setHasBoardAttachments(true);
}
Identity recipient = null;
if( encrypt.isSelected() ) {
recipient = (Identity)buddies.getSelectedItem();
if( recipient == null ) {
JOptionPane.showMessageDialog( this,
language.getString("MessageFrame.encryptErrorNoRecipient.body"),
language.getString("MessageFrame.encryptErrorNoRecipient.title"),
JOptionPane.ERROR);
return;
}
newMessage.setRecipientName(recipient.getUniqueName());
}
UnsentMessagesManager.addNewUnsentMessage(newMessage);
// // zip the xml file and check for maximum size