// Token: 0x06001BF5 RID: 7157 RVA: 0x0006CC0C File Offset: 0x0006AE0C
 internal static void UpdateAttachmentPermissionsAsync(AttachmentDataProvider attachmentDataProvider, string[] userIds, AttachmentPermissionAssignment[] permissionAssignments, UserContext userContext, List <string> resourceList, List <string> largeDLsList)
 {
     try
     {
         OwaDiagnostics.SendWatsonReportsForGrayExceptions(async delegate()
         {
             UpdatePermissionsAsyncResult updatePermissionsAsyncResult = await attachmentDataProvider.UpdateDocumentPermissionsAsync(userIds, permissionAssignments, default(CancellationToken)).ConfigureAwait(false);
             if (updatePermissionsAsyncResult.ResultCode != AttachmentResultCode.Success)
             {
                 UpdateAttachmentPermissions.CreateFailureMessages(userContext, userContext.ExchangePrincipal, null, null, resourceList, null);
             }
             else
             {
                 UpdateAttachmentPermissions.ProcessUpdatePermissionsAsyncResult(userContext, updatePermissionsAsyncResult, resourceList, largeDLsList);
             }
         });
     }
     catch (GrayException ex)
     {
         ExTraceGlobals.AttachmentHandlingTracer.TraceError <string>(0L, "UpdateAttachmentPermissions.UpdateAttachmentPermissionsAsync Exception while trying to update permissions async : {0}", ex.StackTrace);
     }
 }
 // Token: 0x06001BF7 RID: 7159 RVA: 0x0006D004 File Offset: 0x0006B204
 private static void ProcessUpdatePermissionsAsyncResult(UserContext userContext, UpdatePermissionsAsyncResult result, List <string> resourceList, List <string> largeDLsList)
 {
     ExTraceGlobals.AttachmentHandlingTracer.TraceDebug(0L, "[UpdateAttachmentPermissions : ProcessUpdatePermissionsAsyncResult] Method start");
     try
     {
         OwaDiagnostics.SendWatsonReportsForGrayExceptions(delegate()
         {
             Dictionary <string, IList <IUserSharingResult> > dictionary = new Dictionary <string, IList <IUserSharingResult> >();
             foreach (string text in result.ResultsDictionary.Keys)
             {
                 IEnumerable <IUserSharingResult> enumerable = result.ResultsDictionary[text];
                 foreach (IUserSharingResult userSharingResult in enumerable)
                 {
                     if (!userSharingResult.Status)
                     {
                         if (!dictionary.ContainsKey(text))
                         {
                             dictionary.Add(text, new List <IUserSharingResult>());
                         }
                         dictionary[text].Add(userSharingResult);
                     }
                     if (!string.IsNullOrEmpty(userSharingResult.InvitationLink) && !string.IsNullOrEmpty(userSharingResult.User))
                     {
                         ExTraceGlobals.AttachmentHandlingTracer.TraceDebug <string>(0L, "[UpdateAttachmentPermissions : ProcessUpdatePermissionsAsyncResult] Send invitiation for user : {0}", userSharingResult.User);
                         UpdateAttachmentPermissions.SendInvitationMessage(userContext, userContext.ExchangePrincipal, userSharingResult.User, HttpUtility.UrlDecode(text), userSharingResult.InvitationLink);
                     }
                 }
             }
             if (dictionary.Count > 0 || (largeDLsList != null && largeDLsList.Count > 0))
             {
                 ExTraceGlobals.AttachmentHandlingTracer.TraceDebug <int>(0L, "[UpdateAttachmentPermissions : ProcessUpdatePermissionsAsyncResult] There were {0} number of failures when setting perms", dictionary.Count);
                 UpdateAttachmentPermissions.CreateFailureMessages(userContext, userContext.ExchangePrincipal, dictionary, null, resourceList, largeDLsList);
             }
         });
     }
     catch (GrayException ex)
     {
         ExTraceGlobals.AttachmentHandlingTracer.TraceError <string>(0L, "[UpdateAttachmentPermissions : ProcessUpdatePermissionsAsyncResult] Exception happened when processing results : {0}", ex.StackTrace);
     }
 }