* com.cubusmail.gwtui.client.services.IMailboxService#deleteMessages(long
* [])
*/
public void deleteMessages( long[] messageIds ) throws Exception {
IMailbox mailbox = SessionManager.get().getMailbox();
if ( messageIds != null && messageIds.length > 0 ) {
log.debug( "delete " + messageIds.length + " messages..." );
try {
if ( mailbox.getCurrentFolder().isTrash() || mailbox.getTrashFolder() == null ) {
mailbox.deleteMessages( messageIds );
}
else {
copyMoveMessages( messageIds, mailbox.getTrashFolder().getId(), true );
}
}
catch (MessagingException e) {
log.error( e.getMessage(), e );
throw new GWTMessageException( e.getMessage() );