git clone of logicmail with some fixes/features added

Fixes for exceptions when handling untagged responses during message load.

git-svn-id: https://logicmail.svn.sourceforge.net/svnroot/logicmail/trunk@949 5c734088-3d25-0410-9155-b3c3832efda5

octorian 4123eb71 ac95c020

+12 -10
+1 -1
LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapClient.java
··· 1349 1349 MessageFlags messageFlags = new MessageFlags(); 1350 1350 refreshMessageFlags(value.flags, messageFlags); 1351 1351 1352 - if(clientListener != null) { 1352 + if(clientListener != null && token != null) { 1353 1353 clientListener.folderMessageFlagsChanged(token, messageFlags); 1354 1354 } 1355 1355 }
+11 -9
LogicMail/src/org/logicprobe/LogicMail/mail/imap/ImapProtocol.java
··· 1121 1121 // If we don't yet have the raw message body, try to find it in 1122 1122 // the current response line 1123 1123 int offset = Arrays.getIndex(rawList[i], (byte)'('); 1124 - Vector parsedList = ImapParser.parenListParser(rawList[i], offset, rawList[i].length - offset); 1125 - int size = parsedList.size(); 1124 + if(offset != -1) { 1125 + Vector parsedList = ImapParser.parenListParser(rawList[i], offset, rawList[i].length - offset); 1126 + int size = parsedList.size(); 1126 1127 1127 - for(int j=0; j<(size - 1); j++) { 1128 - Object element = parsedList.elementAt(j); 1129 - if(element instanceof String 1130 - && ((String)element).startsWith(BODY) 1131 - && parsedList.elementAt(j + 1) instanceof byte[]) { 1132 - rawMessage = (byte[])parsedList.elementAt(j + 1); 1128 + for(int j=0; j<(size - 1); j++) { 1129 + Object element = parsedList.elementAt(j); 1130 + if(element instanceof String 1131 + && ((String)element).startsWith(BODY) 1132 + && parsedList.elementAt(j + 1) instanceof byte[]) { 1133 + rawMessage = (byte[])parsedList.elementAt(j + 1); 1134 + } 1133 1135 } 1134 1136 } 1135 - 1137 + 1136 1138 // If it wasn't in the current response line, then check for 1137 1139 // an untagged response instead 1138 1140 if(rawMessage == null) {