// Token: 0x06001C02 RID: 7170 RVA: 0x0006D978 File Offset: 0x0006BB78
        private static void CreateFailureMessages(UserContext userContext, ExchangePrincipal exchangePrincipal, Dictionary <string, IList <IUserSharingResult> > failedResultsDictionary, List <string> noProviderResources, List <string> resourceList, List <string> largeDLsList)
        {
            string text = null;
            List <AttachmentFile> list;

            if (noProviderResources != null)
            {
                list = UpdateAttachmentPermissions.GetAttachmentFiles(noProviderResources);
                text = AttachmentMessageBodyGenerator.GenerateBodyForAttachmentNotFound(list);
                UpdateAttachmentPermissions.CreateOneFailureMessage(userContext, exchangePrincipal, text, list);
            }
            if (failedResultsDictionary != null && failedResultsDictionary.Count > 0)
            {
                list = new List <AttachmentFile>();
                List <string>     list2 = new List <string>();
                IRecipientSession adrecipientSession = CallContext.Current.ADRecipientSessionContext.GetADRecipientSession();
                foreach (string text2 in failedResultsDictionary.Keys)
                {
                    AttachmentFile item = new AttachmentFile(UpdateAttachmentPermissions.GetFileNameFromLocation(text2), HttpUtility.UrlDecode(text2));
                    list.Add(item);
                    foreach (IUserSharingResult userSharingResult in failedResultsDictionary[text2])
                    {
                        string text3 = userSharingResult.User;
                        if (text3 != null && !text3.Contains("@"))
                        {
                            text3 = UpdateAttachmentPermissions.ConvertBetweenADRecipientProperties(adrecipientSession, text3, ADRecipientSchema.ExternalDirectoryObjectId, ADRecipientSchema.PrimarySmtpAddress);
                        }
                        if (text3 != null)
                        {
                            list2.Add(text3);
                        }
                    }
                }
                text = AttachmentMessageBodyGenerator.GenerateBodyForSetWrongPermission(list, list2);
                UpdateAttachmentPermissions.CreateOneFailureMessage(userContext, exchangePrincipal, text, list);
            }
            list = UpdateAttachmentPermissions.GetAttachmentFiles(resourceList);
            if (largeDLsList != null && largeDLsList.Count > 0)
            {
                StringBuilder stringBuilder = new StringBuilder();
                foreach (string value in largeDLsList)
                {
                    if (stringBuilder.Length > 0)
                    {
                        stringBuilder.Append(Strings.DistributionListNameSeperator);
                    }
                    stringBuilder.Append(value);
                }
                text = AttachmentMessageBodyGenerator.GenerateBodyForSentToTooLargeDL(list, stringBuilder.ToString());
                UpdateAttachmentPermissions.CreateOneFailureMessage(userContext, exchangePrincipal, text, list);
                return;
            }
            if (text == null)
            {
                text = AttachmentMessageBodyGenerator.GenerateBodyForCatchAll(list);
                UpdateAttachmentPermissions.CreateOneFailureMessage(userContext, exchangePrincipal, text, list);
            }
        }
        // Token: 0x06001BFD RID: 7165 RVA: 0x0006D4DC File Offset: 0x0006B6DC
        private static void ConvertAliasesToExternalDirectoryObjectIds(string[] userIds)
        {
            IRecipientSession adrecipientSession = CallContext.Current.ADRecipientSessionContext.GetADRecipientSession();

            for (int i = 0; i < userIds.Length; i++)
            {
                if (!userIds[i].Contains("@"))
                {
                    string text = UpdateAttachmentPermissions.ConvertBetweenADRecipientProperties(adrecipientSession, userIds[i], ADRecipientSchema.Alias, ADRecipientSchema.ExternalDirectoryObjectId);
                    if (!string.IsNullOrEmpty(text))
                    {
                        userIds[i] = text;
                    }
                }
            }
        }