mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-28 00:09:29 +00:00
Monotone-Parent: 09fd3c049d8fce6a780967f22bad7504e5227848
Monotone-Revision: dce141ada92f68343c2d1685722e6b8c8182168b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-08T13:35:44 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <SOGo/SOGoUser.h>
|
||||
|
||||
#import "SOGoMAPIFSFolder.h"
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
@@ -1071,6 +1073,7 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
{
|
||||
NSMutableDictionary *recipient;
|
||||
NSString *value;
|
||||
SOGoUser *recipientUser;
|
||||
|
||||
recipient = [NSMutableDictionary dictionaryWithCapacity: 5];
|
||||
|
||||
@@ -1078,37 +1081,50 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
{
|
||||
value = [NSString stringWithUTF8String: row->X500DN.recipient_x500name];
|
||||
[recipient setObject: value forKey: @"x500dn"];
|
||||
}
|
||||
|
||||
switch ((row->RecipientFlags & 0x208))
|
||||
{
|
||||
case 0x08:
|
||||
// TODO: we cheat
|
||||
value = [NSString stringWithUTF8String: row->EmailAddress.lpszA];
|
||||
break;
|
||||
case 0x208:
|
||||
value = [NSString stringWithUTF8String: row->EmailAddress.lpszW];
|
||||
break;
|
||||
default:
|
||||
value = nil;
|
||||
recipientUser = [SOGoUser userWithLogin: [value lowercaseString]];
|
||||
if (recipientUser)
|
||||
{
|
||||
value = [recipientUser cn];
|
||||
if ([value length] > 0)
|
||||
[recipient setObject: value forKey: @"fullName"];
|
||||
value = [[recipientUser allEmails] objectAtIndex: 0];
|
||||
if ([value length] > 0)
|
||||
[recipient setObject: value forKey: @"email"];
|
||||
}
|
||||
}
|
||||
if (value)
|
||||
[recipient setObject: value forKey: @"email"];
|
||||
|
||||
switch ((row->RecipientFlags & 0x210))
|
||||
else
|
||||
{
|
||||
case 0x10:
|
||||
// TODO: we cheat
|
||||
value = [NSString stringWithUTF8String: row->DisplayName.lpszA];
|
||||
break;
|
||||
case 0x210:
|
||||
value = [NSString stringWithUTF8String: row->DisplayName.lpszW];
|
||||
break;
|
||||
default:
|
||||
value = nil;
|
||||
switch ((row->RecipientFlags & 0x208))
|
||||
{
|
||||
case 0x08:
|
||||
// TODO: we cheat
|
||||
value = [NSString stringWithUTF8String: row->EmailAddress.lpszA];
|
||||
break;
|
||||
case 0x208:
|
||||
value = [NSString stringWithUTF8String: row->EmailAddress.lpszW];
|
||||
break;
|
||||
default:
|
||||
value = nil;
|
||||
}
|
||||
if (value)
|
||||
[recipient setObject: value forKey: @"email"];
|
||||
|
||||
switch ((row->RecipientFlags & 0x210))
|
||||
{
|
||||
case 0x10:
|
||||
// TODO: we cheat
|
||||
value = [NSString stringWithUTF8String: row->DisplayName.lpszA];
|
||||
break;
|
||||
case 0x210:
|
||||
value = [NSString stringWithUTF8String: row->DisplayName.lpszW];
|
||||
break;
|
||||
default:
|
||||
value = nil;
|
||||
}
|
||||
if (value)
|
||||
[recipient setObject: value forKey: @"fullName"];
|
||||
}
|
||||
if (value)
|
||||
[recipient setObject: value forKey: @"fullName"];
|
||||
|
||||
return recipient;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user