1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-08-13 16:53:51 -04:00

Carddav: fix regression on VCARD photo detection

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1203 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-19 12:45:59 +00:00
parent f729eb27e5
commit 8bd80ecb8e
2 changed files with 10 additions and 1 deletions

View File

@ -1730,7 +1730,7 @@ public abstract class ExchangeSession {
writer.appendProperty("REV", get("lastmodified"));
if ("1".equals(get("haspicture"))) {
if ("true".equals(get("haspicture"))) {
try {
ContactPhoto contactPhoto = getContactPhoto(this);
writer.appendProperty("PHOTO;TYPE=\"" + contactPhoto.contentType + "\";ENCODING=\"b\"", contactPhoto.content);

View File

@ -304,4 +304,13 @@ public class TestExchangeSessionContact extends AbstractExchangeSessionTestCase
}
}
public void testSearchPublicContactsWithPicture() throws IOException {
String folderPath = Settings.getProperty("davmail.publicContactFolder");
List<ExchangeSession.Contact> contacts = session.searchContacts(folderPath, ExchangeSession.CONTACT_ATTRIBUTES, session.isTrue("haspicture"));
int count = 0;
for (ExchangeSession.Contact contact : contacts) {
System.out.println("Contact "+(++count)+ '/' +contacts.size()+contact.getBody());
assertNotNull(session.getContactPhoto(contact));
}
}
}