Merge branch 'msoutlookaddrbook'

cusax-fix
Vincent Lucas 13 years ago
commit 6e2ef5898d

@ -43,7 +43,8 @@ void ComClient_start(void)
{
HRESULT hr = E_FAIL;
if(CoInitializeEx(NULL, COINIT_MULTITHREADED) == S_OK)
if((hr = CoInitializeEx(NULL, COINIT_MULTITHREADED)) == S_OK
|| hr == S_FALSE)
{
// The server may be long to start, then retry 10 times with 1s pause
// between each try.

@ -29,7 +29,8 @@ int main(int argc, char** argv)
{
HRESULT hr = E_FAIL;
if(::CoInitializeEx(NULL, COINIT_MULTITHREADED) != S_OK)
if((hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED)) != S_OK
&& hr != S_FALSE)
{
return hr;
}

@ -375,6 +375,10 @@ public MsOutlookAddrBookContactQuery(
Pattern query)
{
super(msoabcss, query);
if(logger.isDebugEnabled())
{
logger.debug("Creating new query: " + query.toString());
}
}
/**
@ -804,6 +808,10 @@ private boolean matches(int property, String value)
private boolean onMailUser(String id)
throws MsOutlookMAPIHResultException
{
if(logger.isDebugEnabled())
{
logger.debug("Found contact id: " + id);
}
Object[] props
= IMAPIProp_GetProps(
id,
@ -842,8 +850,14 @@ && matches(propIndex, (String) prop)
}
propIndex++;
}
if (matches)
{
if(logger.isDebugEnabled())
{
logger.debug("Contact matches: " + id
+ ", displayName: " + getDisplayName(props));
}
List<ContactDetail> contactDetails = getContactDetails(props);
// What's the point of showing a contact who has no contact details?
@ -960,6 +974,10 @@ public static List<ContactDetail> getContactDetails(Object[] values)
@Override
protected void run()
{
if(logger.isDebugEnabled())
{
logger.debug("run query: " + query.toString());
}
synchronized (MsOutlookAddrBookContactQuery.class)
{
foreachMailUser(
@ -1134,6 +1152,7 @@ public static String getDisplayName(Object[] values)
return displayName;
}
/**
* Gets the organization name to be set on a <tt>SourceContact</tt>.
*

Loading…
Cancel
Save