Exemple #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);
        }
Exemple #2
0
        // Token: 0x06000DAD RID: 3501 RVA: 0x000335F0 File Offset: 0x000317F0
        internal override void HandleNotificationInternal(Notification notification, MapiNotificationsLogEvent logEvent, object context)
        {
            QueryNotification queryNotification = notification as QueryNotification;

            if (queryNotification == null)
            {
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <SmtpAddress, string>((long)this.GetHashCode(), "GroupAssociationNotificationHandler.HandleNotificationInternal: Received a null QueryNotification object for user {0} SubscriptionId: {1}", base.UserContext.PrimarySmtpAddress, base.SubscriptionId);
                logEvent.NullNotification = true;
                return;
            }
            GroupAssociationNotificationPayload payloadFromNotification = this.GetPayloadFromNotification(queryNotification);

            lock (base.SyncRoot)
            {
                this.notifier.AddGroupAssociationNotificationPayload(payloadFromNotification);
                this.notifier.PickupData();
            }
        }
        protected override IList <NotificationPayloadBase> ReadDataAndResetStateInternal()
        {
            List <NotificationPayloadBase> result;

            if (this.refreshAll)
            {
                GroupAssociationNotificationPayload groupAssociationNotificationPayload = new GroupAssociationNotificationPayload();
                groupAssociationNotificationPayload.EventType = QueryNotificationType.Reload;
                groupAssociationNotificationPayload.Source    = MailboxLocation.FromMailboxContext(base.UserContext);
                this.refreshAll = false;
                result          = new List <NotificationPayloadBase>
                {
                    groupAssociationNotificationPayload
                };
                NotificationStatisticsManager.Instance.NotificationCreated(groupAssociationNotificationPayload);
            }
            else
            {
                result = new List <NotificationPayloadBase>(this.payloadQueue);
                this.payloadQueue.Clear();
            }
            return(result);
        }