// Token: 0x06001BFB RID: 7163 RVA: 0x0006D404 File Offset: 0x0006B604
        private static GetMailTipsResponseMessage InvokeGetMailTipsSynchronous(UserContext userContext, GetMailTipsRequest request)
        {
            OwaServerTraceLogger.AppendToLog(new TraceLogEvent("UpdateAttachmentPermissions-GetMailTipsBegin", userContext, "InvokeGetMailTipsSynchronous", "Starting Synchronous call to GetMailTips"));
            GetMailTipsJsonRequest getMailTipsJsonRequest = new GetMailTipsJsonRequest();

            getMailTipsJsonRequest.Body = request;
            OWAService   owaservice  = new OWAService();
            IAsyncResult asyncResult = owaservice.BeginGetMailTips(getMailTipsJsonRequest, null, null);

            asyncResult.AsyncWaitHandle.WaitOne();
            GetMailTipsResponseMessage body = owaservice.EndGetMailTips(asyncResult).Body;

            OwaServerTraceLogger.AppendToLog(new TraceLogEvent("UpdateAttachmentPermissions-GetMailTipsEnd", userContext, "InvokeGetMailTipsSynchronous", "Ending Synchronous call to GetMailTips"));
            return(body);
        }
        // Token: 0x06001BF8 RID: 7160 RVA: 0x0006D088 File Offset: 0x0006B288
        private static string[] ExpandDLsAndGetAllUsers(UserContext userContext, string[] userIds, out List <string> largeDLsList, CallContext callContext)
        {
            List <string> list = new List <string>(userIds);

            largeDLsList = new List <string>();
            Stopwatch stopwatch = Stopwatch.StartNew();
            GetMailTipsResponseMessage mailTipsForUsers = UpdateAttachmentPermissions.GetMailTipsForUsers(userContext, userIds);

            stopwatch.Stop();
            callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.GetMailTipsTime, stopwatch.ElapsedMilliseconds);
            if (mailTipsForUsers.ResponseMessages != null && mailTipsForUsers.ResponseMessages.Length > 0)
            {
                stopwatch = Stopwatch.StartNew();
                int num  = 0;
                int num2 = 0;
                int num3 = 0;
                int num4 = int.MaxValue;
                int num5 = 0;
                ADRecipientExpansion expansion = new ADRecipientExpansion(userContext.ExchangePrincipal.MailboxInfo.OrganizationId);
                foreach (MailTipsResponseMessage mailTipsResponseMessage in mailTipsForUsers.ResponseMessages)
                {
                    XmlDocument xmlDocument = new XmlDocument();
                    xmlDocument.LoadXml(mailTipsResponseMessage.MailTips.OuterXml);
                    XmlNode xmlNode  = xmlDocument.SelectSingleNode("//*[local-name()=\"EmailAddress\"]");
                    XmlNode xmlNode2 = xmlDocument.SelectSingleNode("//*[local-name()=\"TotalMemberCount\"]");
                    if (xmlNode2 != null && !string.IsNullOrEmpty(xmlNode2.InnerText) && xmlNode != null && !string.IsNullOrEmpty(xmlNode.InnerText))
                    {
                        int num6 = int.Parse(xmlNode2.InnerText);
                        if (num6 != 1)
                        {
                            list.Remove(xmlNode.InnerText);
                            num++;
                            num3 += num6;
                            if (num4 > num6)
                            {
                                num4 = num6;
                            }
                            if (num5 < num6)
                            {
                                num5 = num6;
                            }
                        }
                        if (num6 > 1 && num6 <= 100)
                        {
                            UpdateAttachmentPermissions.AddDLMembersToResults(list, expansion, xmlNode.InnerText);
                        }
                        else if (num6 > 100)
                        {
                            largeDLsList.Add(xmlNode.InnerText);
                            ExTraceGlobals.AttachmentHandlingTracer.TraceError <string, int>(0L, "[UpdateAttachmentPermissions : ExpandDLsAndGetAllUsers] size of DL {0} was {1}, not setting permissions.", xmlNode.InnerText, num6);
                            num2++;
                        }
                    }
                    else
                    {
                        ExTraceGlobals.AttachmentHandlingTracer.TraceError(0L, "[UpdateAttachmentPermissions : ExpandDLsAndGetAllUsers] Error parsing GetMailTips response.");
                    }
                }
                stopwatch.Stop();
                callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.DLExpandTime, stopwatch.ElapsedMilliseconds);
                callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfDLs, num);
                if (num > 0)
                {
                    callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfLargeDLs, num2);
                    callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfRecipientsInDLs, num3);
                    callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfRecipientsInSmallestDL, num4);
                    callContext.ProtocolLog.Set(UpdateAttachmentPermissionsMetadata.NumberOfRecipientsInLargestDL, num5);
                }
            }
            else
            {
                ExTraceGlobals.AttachmentHandlingTracer.TraceError(0L, "[UpdateAttachmentPermissions : ExpandDLsAndGetAllUsers] GetMailTips response was empty.");
            }
            return(list.ToArray());
        }