- Timestamp:
- 08/02/08 05:15:29 PM (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapClient.java
r259 r262 377 377 FolderMessage[] folderMessages = new FolderMessage[response.length]; 378 378 for(int i=0;i<response.length;i++) { 379 folderMessages[i] = new FolderMessage(response[i].envelope, response[i].index );379 folderMessages[i] = new FolderMessage(response[i].envelope, response[i].index, response[i].uid); 380 380 folderMessages[i].setSeen(response[i].flags.seen); 381 381 folderMessages[i].setAnswered(response[i].flags.answered); … … 391 391 392 392 public Message getMessage(FolderMessage folderMessage) throws IOException, MailException { 393 ImapParser.MessageSection structure = getMessageStructure(folderMessage.get Index());393 ImapParser.MessageSection structure = getMessageStructure(folderMessage.getUid()); 394 394 MessagePart rootPart = 395 getMessagePart(folderMessage.get Index(),395 getMessagePart(folderMessage.getUid(), 396 396 structure, globalConfig.getImapMaxMsgSize()); 397 397 Message msg = new Message(folderMessage.getEnvelope(), rootPart); … … 399 399 } 400 400 401 private MessagePart getMessagePart(int index,401 private MessagePart getMessagePart(int uid, 402 402 ImapParser.MessageSection structure, 403 403 int maxSize) … … 411 411 else { 412 412 if(structure.size < maxSize) { 413 data = getMessageBody( index, structure.address);413 data = getMessageBody(uid, structure.address); 414 414 maxSize -= structure.size; 415 415 } … … 426 426 if((part instanceof MultiPart)&&(structure.subsections != null)&&(structure.subsections.length > 0)) { 427 427 for(int i=0;i<structure.subsections.length;i++) { 428 MessagePart subPart = getMessagePart( index, structure.subsections[i], maxSize);428 MessagePart subPart = getMessagePart(uid, structure.subsections[i], maxSize); 429 429 if(subPart != null) { 430 430 ((MultiPart)part).addPart(subPart); … … 439 439 * This tree is used to build the final message tree. 440 440 */ 441 private ImapParser.MessageSection getMessageStructure(int msgIndex) throws IOException, MailException {441 private ImapParser.MessageSection getMessageStructure(int uid) throws IOException, MailException { 442 442 if(activeMailbox.equals("")) { 443 443 throw new MailException("Mailbox not selected"); 444 444 } 445 445 446 return imapProtocol.executeFetchBodystructure( msgIndex);446 return imapProtocol.executeFetchBodystructure(uid); 447 447 } 448 448 … … 466 466 } 467 467 468 private String getMessageBody(int index, String address) throws IOException, MailException {468 private String getMessageBody(int uid, String address) throws IOException, MailException { 469 469 if(activeMailbox.equals("")) { 470 470 throw new MailException("Mailbox not selected"); 471 471 } 472 472 473 return imapProtocol.executeFetchBody( index, address);473 return imapProtocol.executeFetchBody(uid, address); 474 474 } 475 475 476 476 public void deleteMessage(FolderMessage folderMessage) throws IOException, MailException { 477 477 ImapProtocol.MessageFlags updatedFlags = 478 imapProtocol.executeStore(folderMessage.get Index(), true, new String[] { "\\Deleted" });478 imapProtocol.executeStore(folderMessage.getUid(), true, new String[] { "\\Deleted" }); 479 479 refreshMessageFlags(updatedFlags, folderMessage); 480 480 } … … 483 483 public void undeleteMessage(FolderMessage folderMessage) throws IOException, MailException { 484 484 ImapProtocol.MessageFlags updatedFlags = 485 imapProtocol.executeStore(folderMessage.get Index(), false, new String[] { "\\Deleted" });485 imapProtocol.executeStore(folderMessage.getUid(), false, new String[] { "\\Deleted" }); 486 486 refreshMessageFlags(updatedFlags, folderMessage); 487 487 } … … 495 495 public void messageAnswered(FolderMessage folderMessage) throws IOException, MailException { 496 496 ImapProtocol.MessageFlags updatedFlags = 497 imapProtocol.executeStore(folderMessage.get Index(), true, new String[] { "\\Answered" });497 imapProtocol.executeStore(folderMessage.getUid(), true, new String[] { "\\Answered" }); 498 498 refreshMessageFlags(updatedFlags, folderMessage); 499 499 }
