コード例 #1
0
        // Token: 0x06000DB2 RID: 3506 RVA: 0x00033824 File Offset: 0x00031A24
        private GroupAssociationNotificationPayload GetPayloadFromNotification(QueryNotification notification)
        {
            GroupAssociationNotificationPayload groupAssociationNotificationPayload = new GroupAssociationNotificationPayload();

            groupAssociationNotificationPayload.SubscriptionId = base.SubscriptionId;
            groupAssociationNotificationPayload.EventType      = notification.EventType;
            groupAssociationNotificationPayload.Source         = MailboxLocation.FromMailboxContext(base.UserContext);
            if (notification.EventType != QueryNotificationType.RowDeleted)
            {
                string itemProperty  = GroupAssociationNotificationHandler.GetItemProperty <string>(notification, 0, string.Empty);
                string itemProperty2 = GroupAssociationNotificationHandler.GetItemProperty <string>(notification, 1, string.Empty);
                bool   itemProperty3 = GroupAssociationNotificationHandler.GetItemProperty <bool>(notification, 2, false);
                GroupMailboxLocator groupMailboxLocator = new GroupMailboxLocator(this.adSession, itemProperty, itemProperty2);
                ADUser aduser = groupMailboxLocator.FindAdUser();
                if (aduser != null)
                {
                    groupAssociationNotificationPayload.Group = new ModernGroupType
                    {
                        DisplayName = aduser.DisplayName,
                        SmtpAddress = aduser.PrimarySmtpAddress.ToString(),
                        IsPinned    = itemProperty3
                    };
                }
                else
                {
                    ExTraceGlobals.NotificationsCallTracer.TraceError <string, string>((long)this.GetHashCode(), "GroupAssociationNotificationHandler.GetPayloadFromNotification: Could not find Group in AD with ExternalObjectId {0} or LegacyDn {1}", itemProperty, itemProperty2);
                }
            }
            return(groupAssociationNotificationPayload);
        }
コード例 #2
0
        private List <string> CalculateTargetUsers(ADUser adUser, IRecipientSession adSession, StoreSession session)
        {
            GroupMailboxLocator groupMailboxLocator = GroupMailboxLocator.Instantiate(adSession, new SmtpProxyAddress(session.MailboxOwner.MailboxInfo.PrimarySmtpAddress.ToString(), true));
            ADUser aduser = adUser ?? groupMailboxLocator.FindAdUser();

            if (aduser == null)
            {
                return(new List <string>());
            }
            List <string>    groupPinners = this.GetGroupPinners(session, groupMailboxLocator);
            List <string>    groupOwners  = this.GetGroupOwners(aduser);
            HashSet <string> hashSet      = new HashSet <string>(groupPinners);

            foreach (string item in groupOwners)
            {
                hashSet.Add(item);
            }
            if (hashSet.Count != 0)
            {
                List <string> groupSubscribers = this.GetGroupSubscribers(session, groupMailboxLocator);
                foreach (string item2 in groupSubscribers)
                {
                    hashSet.Remove(item2);
                }
                List <string> list = new List <string>();
                foreach (string text in hashSet)
                {
                    if (!this.IsUserFlighted(adSession, text))
                    {
                        list.Add(text);
                    }
                }
                foreach (string item3 in list)
                {
                    hashSet.Remove(item3);
                }
            }
            return(hashSet.ToList <string>());
        }