Пример #1
0
        private static byte[] GetSyncMessageIdHash(MessageRec message, MessageRecType messageRecType, FolderHierarchy hierarchy)
        {
            string text = message[hierarchy.SourceSyncMessageIdPtag] as string;

            if (!string.IsNullOrEmpty(text))
            {
                return(CommonUtils.GetSHA1Hash(text.ToLowerInvariant()));
            }
            return(null);
        }
 protected virtual List <byte[]> GetSecondaryKeys(MessageRec message, MessageRecType messageRecType)
 {
     if (!messageRecType.Equals(MessageRecType.Source))
     {
         return(new List <byte[]>(1)
         {
             this.GetKeyPlusLMTHash(message, PropTag.SearchKey, this.destHierarchy.SourceLastModifiedTimestampPtag)
         });
     }
     return(new List <byte[]>(1)
     {
         this.GetKeyPlusLMTHash(message, PropTag.SearchKey, PropTag.LastModificationTime)
     });
 }
Пример #3
0
 protected override List <byte[]> GetSecondaryKeys(MessageRec message, MessageRecType messageRecType)
 {
     if (!messageRecType.Equals(MessageRecType.Source))
     {
         return(new List <byte[]>(2)
         {
             ImapFolderContentsMapper.GetImapSyncPropertiesHash(message, this.destHierarchy),
             ImapFolderContentsMapper.GetCloudIdHash(message, messageRecType, this.destHierarchy)
         });
     }
     return(new List <byte[]>(2)
     {
         ImapFolderContentsMapper.GetImapSyncPropertiesHash(message, this.sourceHierarchy),
         ImapFolderContentsMapper.GetSyncMessageIdHash(message, messageRecType, this.sourceHierarchy)
     });
 }
Пример #4
0
        private static byte[] GetCloudIdHash(MessageRec message, MessageRecType messageRecType, FolderHierarchy hierarchy)
        {
            if (message[hierarchy.SharingInstanceGuidPtag] == null || Guid.Empty.Equals((Guid)message[hierarchy.SharingInstanceGuidPtag]))
            {
                return(null);
            }
            string text = message[hierarchy.CloudIdPtag] as string;

            if (!string.IsNullOrEmpty(text))
            {
                string[] array = text.Split(new char[]
                {
                    ' '
                });
                if (array.Length == 2)
                {
                    return(CommonUtils.GetSHA1Hash(array[1].ToLowerInvariant()));
                }
            }
            return(null);
        }