public static void Send(FileEntry entry1, FileEntry entry2, Dictionary<string, string> headers, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry1 == null || entry2 == null || entry1.RootFolderType == FolderType.USER || entry2.RootFolderType == FolderType.USER) return;

            SendHeadersMessage(headers, action, description);
        }
 public static EventMessage Create(HttpRequest request, string initiator, MessageAction action, params string[] description)
 {
     try
     {
         return new EventMessage
             {
                 IP = request.Headers["X-Forwarded-For"] ?? request.UserHostAddress,
                 Initiator = initiator,
                 Browser = string.Format("{0} {1}", request.Browser.Browser, request.Browser.Version),
                 Platform = request.Browser.Platform,
                 Date = DateTime.UtcNow,
                 TenantId = CoreContext.TenantManager.GetCurrentTenant().TenantId,
                 UserId = SecurityContext.CurrentAccount.ID,
                 Page = request.UrlReferrer == null
                            ? string.Empty :
                            request.UrlReferrer.ToString(),
                 Action = action,
                 Description = description
             };
     }
     catch(Exception ex)
     {
         log.Error(string.Format("Error while parse Http Request for \"{0}\" type of event: {1}", action, ex));
         return null;
     }
 }
        public static void ScriptLoaded(DOLEvent e, object sender, EventArgs args)
        {
            if (!ServerProperties.Properties.LOAD_EXAMPLES)
                return;

            #region defineNPCs

            GameNPC[] npcs = WorldMgr.GetNPCsByName("Sir Quait", eRealm.Albion);
            npcs = WorldMgr.GetNPCsByName("Sir Quait", (eRealm)1);
            GameNPC SirQuait = null;
            if (npcs.Length == 0)
            {
                SirQuait = new DOL.GS.GameNPC();
                SirQuait.Model = 40;
                SirQuait.Name = "Sir Quait";
                if (log.IsWarnEnabled)
                    log.Warn("Could not find " + SirQuait.Name + ", creating ...");
                SirQuait.Realm = eRealm.Albion;
                SirQuait.CurrentRegionID = 1;
                SirQuait.Size = 50;
                SirQuait.Level = 10;
                SirQuait.MaxSpeedBase = 100;
                SirQuait.Faction = FactionMgr.GetFactionByID(0);
                SirQuait.X = 531971;
                SirQuait.Y = 478955;
                SirQuait.Z = 0;
                SirQuait.Heading = 3570;
                SirQuait.RespawnInterval = 0;
                SirQuait.BodyType = 0;

                StandardMobBrain brain = new StandardMobBrain();
                brain.AggroLevel = 0;
                brain.AggroRange = 0;
                SirQuait.SetOwnBrain(brain);

                SirQuait.AddToWorld();
            }
            else
            {
                SirQuait = npcs[0];
            }

            #endregion defineNPCs

            #region defineBehaviours

            BaseBehaviour b = new BaseBehaviour(SirQuait);
            MessageAction a = new MessageAction(SirQuait, "This is just a simple test bahaviour.", eTextType.Emote);
            b.AddAction(a);
            InteractTrigger t = new InteractTrigger(SirQuait, b.NotifyHandler, SirQuait);
            b.AddTrigger(t);

            // store the behaviour in a list so it won't be garbage collected
            behaviours.Add(b);

            #endregion defineBehaviours

            log.Info("Simple Test Behaviour added");
        }
Beispiel #4
0
 public Message(string receiver, MessageAction action, string property, string value, PropType propType)
 {
     Action = action;
     Receiver = receiver;
     Property = property;
     PropType = propType;
     Value = value;
 }
Beispiel #5
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            ListView.ItemClick += (sender, e) => {
                //already in action mode?
                if (_actionMode != null)
                    return;

                //toggle system ui visibility
                if (_systemUiVisible)
                {
                    Activity.Window.ClearFlags (WindowManagerFlags.Fullscreen);
                    ListView.SystemUiVisibility = StatusBarVisibility.Visible;
                    Activity.ActionBar.Show ();
                }
                else
                {
                    Activity.Window.SetFlags (0, WindowManagerFlags.Fullscreen);
                    ListView.SystemUiVisibility = StatusBarVisibility.Hidden;
                    Activity.ActionBar.Hide ();
                }
                _systemUiVisible = !_systemUiVisible;
            };

            ListView.ItemLongClick += delegate(object sender, AdapterView.ItemLongClickEventArgs e) {
                if (_actionMode != null)
                    return;

                var callback = new MessageAction(Activity.GetString(Resource.String.message_action_title),
                                                 Activity.GetString(Resource.String.message_action_subtitle));

                callback.DeleteActionHandler += delegate {
                    DeleteMessage (_sortedItems[e.Position]);
                    _actionMode.Finish ();
                    _actionMode = null;
                };

                callback.ViewActionHandler += delegate {
                    ViewMessage(_sortedItems[e.Position]);
                    _actionMode.Finish ();
                    _actionMode = null;
                };

                callback.CopyActionHandler += delegate {
                    CopyMessage (_sortedItems[e.Position]);
                    _actionMode.Finish ();
                    _actionMode = null;
                };

                callback.DestroyActionHandler += delegate {
                    _actionMode = null;
                };

                _actionMode = Activity.StartActionMode (callback);
            };
        }
Beispiel #6
0
        public IList GetMessagesByAction( MessageAction action )
        {
            IList list = new ArrayList();

            foreach( Message message in mMessages.Values )
                if( message.Action == action )
                    list.Add( message );

            return list;
        }
        private static void SendHeadersMessage(Dictionary<string, string> headers, MessageAction action, params string[] description)
        {
            if (headers == null)
            {
                log.Debug(string.Format("Empty Request Headers for \"{0}\" type of event", action));
                return;
            }

            MessageService.Send(headers, action, description);
        }
        public static void Send(FileEntry entry, HttpRequest request, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry == null || entry.RootFolderType == FolderType.USER) return;

            if (request == null)
            {
                log.Debug(string.Format("Empty Http Request for \"{0}\" type of event", action));
                return;
            }

            MessageService.Send(request, action, description);
        }
        public static EventMessage Create(MessageUserData userData, Dictionary<string, string> headers, MessageAction action, params string[] description)
        {
            try
            {
                var message = new EventMessage
                    {
                        Date = DateTime.UtcNow,
                        TenantId = userData == null ? CoreContext.TenantManager.GetCurrentTenant().TenantId : userData.TenantId,
                        UserId = userData == null ? SecurityContext.CurrentAccount.ID : userData.UserId,
                        Action = action,
                        Description = description
                    };

                if (headers != null)
                {
                    var userAgent = headers.ContainsKey(userAgentHeader) ? headers[userAgentHeader] : null;
                    var forwarded = headers.ContainsKey(forwardedHeader) ? headers[forwardedHeader] : null;
                    var host = headers.ContainsKey(hostHeader) ? headers[hostHeader] : null;
                    var referer = headers.ContainsKey(refererHeader) ? headers[refererHeader] : null;

                    var uaParser = Parser.GetDefault();
                    ClientInfo clientInfo;

                    try
                    {
                        clientInfo = userAgent != null ? uaParser.Parse(userAgent) : null;
                    }
                    catch (Exception)
                    {
                        clientInfo = null;
                    }

                    message.IP = forwarded ?? host;
                    message.Browser = GetBrowser(clientInfo);
                    message.Platform = GetPlatform(clientInfo);
                    message.Page = referer;
                }

                return message;
            }
            catch (Exception ex)
            {
                log.Error(string.Format("Error while parse Http Message for \"{0}\" type of event: {1}", action, ex));
                return null;
            }
        }
 public bool UpdateRecord(MessageAction action, Customer customer)
 {
     string cardNumber = customer.CreditCardNumber;
     var encryptor = new CreditCardEncryption();
     customer.CreditCardNumber = encryptor.Encrypt(cardNumber);
     try
     {
         using (var client = new CustomerServiceClient())
         {
             client.Open();
             return client.UpdateRecord(action, customer);
         }
     }
     finally
     {
         customer.CreditCardNumber = cardNumber;
     }
 }
Beispiel #11
0
        public BaseMessage(XmlDocument message, Settings settings, MessageAction messageAction)
        {
            this.Message = message;
              this.MessageAction = messageAction;

              this.Settings = settings;
              this.signMessage = SignMessage.Create(this.Settings);

              Dictionary<string, MessageType> types = new Dictionary<string, MessageType>();
              types.Add("InvoiceRequest", MessageType.Invoice);
              types.Add("BusinessPremiseRequest", MessageType.BusinessPremise);
              types.Add("EchoRequest", MessageType.Echo);

              string root = this.Message.DocumentElement.LocalName;
              if (types.ContainsKey(root))
            this.MessageType = types[root];
              else
            this.MessageType = MessageType.Unknown;
        }
        public static MessageWrapper GetMessageWrapper(string source, MessageAction action, BaseMessage message, DateTime timeStamp)
        {
            MessageWrapper wrapper = new MessageWrapper();

            wrapper.Action = action;
            wrapper.Time = string.Format("{0}:{1} {2}.{3}", timeStamp.Hour, timeStamp.Minute, timeStamp.Second, timeStamp.Millisecond);
            wrapper.Key = message.Key;
            wrapper.Source = source;

            if (_messageTranslators.ContainsKey(wrapper.Key))
            {
                BaseMessage toUse = _messageTranslators[wrapper.Key](message);

                if (_messageWriter.ContainsKey(wrapper.Key))
                {
                    wrapper.Message = _messageWriter[wrapper.Key](toUse);
                }
            }

            return wrapper;
        }
        public static EventMessage Create(HttpRequest request, string initiator, MessageAction action, params string[] description)
        {
            try
            {
                var clientInfo = (ClientInfo)null;
                if (request != null)
                {
                    try
                    {
                        var uaParser = Parser.GetDefault();
                        var userAgent = request.Headers[userAgentHeader];
                        clientInfo = userAgent != null ? uaParser.Parse(userAgent) : null;
                    }
                    catch (Exception)
                    {
                        // ignore
                    }
                }

                return new EventMessage
                    {
                        IP = request != null ? request.Headers[forwardedHeader] ?? request.UserHostAddress : null,
                        Initiator = initiator,
                        Browser = GetBrowser(clientInfo),
                        Platform = GetPlatform(clientInfo),
                        Date = DateTime.UtcNow,
                        TenantId = CoreContext.TenantManager.GetCurrentTenant().TenantId,
                        UserId = SecurityContext.CurrentAccount.ID,
                        Page = request != null && request.UrlReferrer != null ? request.UrlReferrer.ToString() : null,
                        Action = action,
                        Description = description
                    };
            }
            catch (Exception ex)
            {
                log.ErrorFormat("Error while parse Http Request for {0} type of event: {1}", action, ex);
                return null;
            }
        }
 public static void Send(HttpRequest request, string loginName, MessageAction action, string d1)
 {
     SendRequestMessage(request, loginName, action, d1);
 }
 public static void Send(HttpRequest request, MessageAction action, string d1, string d2)
 {
     SendRequestMessage(request, null, action, d1, d2);
 }
Beispiel #16
0
 public static void Send(Dictionary <string, string> httpHeaders, MessageAction action, MessageTarget target)
 {
     SendHeadersMessage(null, httpHeaders, action, target);
 }
Beispiel #17
0
        private static void SendHeadersMessage(MessageUserData userData, Dictionary <string, string> httpHeaders, MessageAction action, MessageTarget target, params string[] description)
        {
            if (sender == null)
            {
                return;
            }

            var message = MessageFactory.Create(userData, httpHeaders, action, target, description);

            if (!MessagePolicy.Check(message))
            {
                return;
            }

            sender.Send(message);
        }
Beispiel #18
0
 public static void Send(HttpRequest request, string loginName, MessageAction action)
 {
     SendRequestMessage(request, loginName, action);
 }
Beispiel #19
0
        private async Task Init()
        {
            //加载索引
            DataIndex = await Load <DataIndex>(dataIndexKey);

            if (DataIndex == null)
            {
                //首次使用
                DataIndex = new DataIndex {
                    Key = dataIndexKey, Created = DateTime.Now, Creator = Operator.Name
                };
                return;
            }

            //加载数据
            foreach (var item in DataIndex.Projects)
            {
                var dat = await Load <Project>(item);

                if (dat == null)
                {
                    continue;
                }
                Projects.Add(dat);
            }

            foreach (var item in DataIndex.Todos)
            {
                var dat = await Load <Todo>(item);

                if (dat == null)
                {
                    continue;
                }
                Todos.Add(dat);
                if (string.IsNullOrWhiteSpace(dat.ProjcectId))
                {
                    IndexProject.Todos.Add(dat.Key);
                }
            }

            foreach (var item in DataIndex.DayLogs)
            {
                var dat = await Load <DayLog>(item);

                if (dat == null)
                {
                    continue;
                }
                DayLogs.Add(dat);
                dat.TodoLogs.ForEach(x =>
                {
                    if (string.IsNullOrWhiteSpace(x.ProjcectId))
                    {
                        IndexProject.DayLogs.Add(x.Key);
                    }
                });
            }

            foreach (var item in DataIndex.Reports)
            {
                var dat = await Load <Report>(item);

                if (dat == null)
                {
                    continue;
                }
                Reports.Add(dat);
            }

            MessageAction?.Invoke(MessageTypeUpdate);
        }
        private static void SendInitiatorMessage(HttpRequest request, string initiator, MessageAction action, params string[] description)
        {
            if (sender == null) return;

            var message = MessageFactory.Create(request, initiator, action, description);
            if (!MessagePolicy.Check(message)) return;

            sender.Send(message);
        }
        public async Task <HttpStatusCode> ProcessAsync(string message, long sequenceNumber, MessageContentType messageContentType, MessageAction messageAction)
        {
            if (messageContentType == MessageContentType.JobProfile)
            {
                return(await ProcessJobProfileMessageAsync(message, messageAction, sequenceNumber)
                       .ConfigureAwait(false));
            }

            return(await Task.FromResult(HttpStatusCode.InternalServerError).ConfigureAwait(false));
        }
Beispiel #22
0
 internal MessageStoreChangedEventArgs(IMessage message, MessageAction action)
 {
     this.message = message;
     this.action  = action;
 }
Beispiel #23
0
 private bool IsMessageActionMatch(MessageAction action, IBotChat chat, IBotInputMessage message) =>
 action.Metadata.MessagePattern.IsMatch(message.Content) &&
 action.Metadata.LatestQuery.IsMatch(chat.LastExecutedQuery);
Beispiel #24
0
 internal ProtocolMessage(MessageAction action, string channel)
     : this(action)
 {
     Channel = channel;
 }
Beispiel #25
0
 internal ProtocolMessage(MessageAction action)
     : this()
 {
     Action = action;
 }
Beispiel #26
0
        public void Send <T>(FileEntry <T> entry, Dictionary <string, string> headers, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry == null || entry.RootFolderType == FolderType.USER)
            {
                return;
            }

            SendHeadersMessage(headers, action, MessageTarget.Create(entry.ID), description);
        }
Beispiel #27
0
        public static int SendLoginMessage(HttpRequest request, MessageUserData userData, MessageAction action)
        {
            if (sender == null)
            {
                return(0);
            }

            var message = MessageFactory.Create(request, userData, action);

            if (!MessagePolicy.Check(message))
            {
                return(0);
            }

            var id = sender.Send(message);

            return(id);
        }
 public static void Send(Dictionary<string, string> httpHeaders, MessageAction action, string d1)
 {
     SendHeadersMessage(httpHeaders, action, d1);
 }
 public static void Send(HttpRequest request, MessageInitiator initiator, MessageAction action, params string[] description)
 {
     SendInitiatorMessage(request, initiator.ToString(), action, description);
 }
        private async Task <HttpStatusCode> ProcessJobProfileMessageAsync(string message, MessageAction messageAction, long sequenceNumber)
        {
            var jobProfile = mappingService.MapToSegmentModel(message, sequenceNumber);

            switch (messageAction)
            {
            case MessageAction.Draft:
            case MessageAction.Published:
                var result = await httpClientService.PutAsync(jobProfile).ConfigureAwait(false);

                if (result == HttpStatusCode.NotFound)
                {
                    return(await httpClientService.PostAsync(jobProfile).ConfigureAwait(false));
                }

                return(result);

            case MessageAction.Deleted:
                return(await httpClientService.DeleteAsync(jobProfile.DocumentId).ConfigureAwait(false));

            default:
                throw new ArgumentOutOfRangeException(nameof(messageAction), $"Invalid message action '{messageAction}' received, should be one of '{string.Join(",", Enum.GetNames(typeof(MessageAction)))}'");
            }
        }
 public static void Send(ApiContext context, string user, MessageAction action)
 {
     SendApiMessage(context, user, action);
 }
 public static void Send(Dictionary <string, string> headers, MessageAction action)
 {
     SendHeadersMessage(headers, action, null);
 }
Beispiel #33
0
 public static void Send(HttpRequest request, string loginName, MessageAction action, string d1)
 {
     SendRequestMessage(request, loginName, null, action, null, d1);
 }
        public static void Send(FileEntry entry1, FileEntry entry2, Dictionary <string, string> headers, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry1 == null || entry2 == null || entry1.RootFolderType == FolderType.USER || entry2.RootFolderType == FolderType.USER)
            {
                return;
            }

            SendHeadersMessage(headers, action, MessageTarget.Create(new[] { entry1.ID, entry2.ID }), description);
        }
Beispiel #35
0
 internal MessageStatus(MessageAction action, SmtpResponse smtpResponse, Exception exception, bool forAllRecipients) : this(action, smtpResponse, exception, forAllRecipients, null)
 {
 }
Beispiel #36
0
        private static void SendRequestMessage(HttpRequest request, string loginName, MessageAction action,
                                               params string[] description)
        {
            if (sender == null)
            {
                return;
            }

            if (request == null)
            {
                log.Debug(string.Format("Empty Http Request for \"{0}\" type of event", action));
                return;
            }

            var message = MessageFactory.Create(request, loginName, action, description);

            if (!MessagePolicy.Check(message))
            {
                return;
            }

            sender.Send(message);
        }
Beispiel #37
0
 public void Send(IDictionary <string, StringValues> headers, MessageAction action)
 {
     SendHeadersMessage(headers, action, null);
 }
Beispiel #38
0
 public static void Send(MessageUserData userData, Dictionary <string, string> httpHeaders, MessageAction action)
 {
     SendHeadersMessage(userData, httpHeaders, action);
 }
 public static void Send(HttpRequest request, MessageAction action)
 {
     SendRequestMessage(request, null, action);
 }
Beispiel #40
0
 public static void Send(Dictionary <string, string> httpHeaders, MessageAction action, string d1)
 {
     SendHeadersMessage(null, httpHeaders, action, d1);
 }
 public static void Send(HttpRequest request, MessageAction action, IEnumerable<string> d1)
 {
     SendRequestMessage(request, null, action, string.Join(", ", d1));
 }
Beispiel #42
0
 public static void Send(Dictionary <string, string> httpHeaders, MessageAction action, IEnumerable <string> d1)
 {
     SendHeadersMessage(null, httpHeaders, action, d1 != null ? d1.ToArray() : null);
 }
        private static void SendRequestMessage(HttpRequest request, string loginName, MessageAction action, params string[] description)
        {
            if (sender == null) return;

            if (request == null)
            {
                log.Debug(string.Format("Empty Http Request for \"{0}\" type of event", action));
                return;
            }

            var message = MessageFactory.Create(request, loginName, action, description);
            if (!MessagePolicy.Check(message)) return;

            sender.Send(message);
        }
Beispiel #44
0
 public static void Send(HttpRequest request, MessageInitiator initiator, MessageAction action,
                         params string[] description)
 {
     SendInitiatorMessage(request, initiator.ToString(), action, description);
 }
        private static void SendHeadersMessage(Dictionary<string, string> httpHeaders, MessageAction action, params string[] description)
        {
            if (sender == null) return;

            if (httpHeaders == null)
            {
                log.Debug(string.Format("Empty Request Headers for \"{0}\" type of event", action));
                return;
            }

            var message = MessageFactory.Create(httpHeaders, action, description);
            if (!MessagePolicy.Check(message)) return;

            sender.Send(message);
        }
 public static void Send(FileEntry entry, MessageInitiator initiator, MessageAction action, params string[] description)
 {
     SendInitiatorMessage(entry, initiator, action, description);
 }
 public static void Send(MessageInitiator initiator, MessageAction action, params string[] description)
 {
     SendInitiatorMessage(null, initiator.ToString(), action, description);
 }
Beispiel #48
0
        public void Send <T1, T2>(FileEntry <T1> entry1, FileEntry <T2> entry2, IDictionary <string, StringValues> headers, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry1 == null || entry2 == null || entry1.RootFolderType == FolderType.USER || entry2.RootFolderType == FolderType.USER)
            {
                return;
            }

            SendHeadersMessage(headers, action, MessageTarget.Create(new[] { entry1.ID.ToString(), entry2.ID.ToString() }), description);
        }
 public static void Send(ApiContext context, MessageAction action)
 {
     SendApiMessage(context, null, action);
 }
 public static void Send(Dictionary<string, string> headers, MessageAction action)
 {
     SendHeadersMessage(headers, action, null);
 }
 public static void Send(ApiContext context, MessageAction action, string d1, string d2)
 {
     SendApiMessage(context, null, action, d1, d2);
 }
        public static EventMessage Create(MessageUserData userData, Dictionary<string, string> headers, MessageAction action, MessageTarget target, params string[] description)
        {
            try
            {
                var message = new EventMessage
                {
                    Date = DateTime.UtcNow,
                    TenantId = userData == null ? CoreContext.TenantManager.GetCurrentTenant().TenantId : userData.TenantId,
                    UserId = userData == null ? SecurityContext.CurrentAccount.ID : userData.UserId,
                    Action = action,
                    Description = description,
                    Target = target
                };

                if (headers != null)
                {
                    var userAgent = headers.ContainsKey(userAgentHeader) ? headers[userAgentHeader] : null;
                    var forwarded = headers.ContainsKey(forwardedHeader) ? headers[forwardedHeader] : null;
                    var host = headers.ContainsKey(hostHeader) ? headers[hostHeader] : null;
                    var referer = headers.ContainsKey(refererHeader) ? headers[refererHeader] : null;

                    message.IP = forwarded ?? host;
                    message.UAHeader = userAgent;
                    message.Page = referer;
                }

                return message;
            }
            catch (Exception ex)
            {
                log.Error(string.Format("Error while parse Http Message for \"{0}\" type of event: {1}", action, ex));
                return null;
            }
        }
Beispiel #53
0
 public static void SendKISMessage(Part destPart, MessageAction action, Part tgtPart = null, AttachNode tgtNode = null)
 {
     BaseEventData bEventData = new BaseEventData(BaseEventData.Sender.AUTO);
     bEventData.Set("action", action.ToString());
     bEventData.Set("targetPart", tgtPart);
     bEventData.Set("targetNode", tgtNode);
     destPart.SendMessage("OnKISAction", bEventData, SendMessageOptions.DontRequireReceiver);
 }
Beispiel #54
0
 public static void Send(HttpRequest request, MessageAction action, string d1)
 {
     SendRequestMessage(request, null, action, d1);
 }
Beispiel #55
0
 public static void Send(HttpRequest request, MessageAction action, string d1, string d2, string d3, string d4)
 {
     SendRequestMessage(request, null, action, d1, d2, d3, d4);
 }
Beispiel #56
0
 public static void Send(HttpRequest request, MessageAction action, IEnumerable <string> d1)
 {
     SendRequestMessage(request, null, action, string.Join(", ", d1));
 }
Beispiel #57
0
 public static void Send(MessageInitiator initiator, MessageAction action, params string[] description)
 {
     SendInitiatorMessage(null, initiator.ToString(), action, description);
 }
Beispiel #58
0
 public static void Send(HttpRequest request, MessageAction action)
 {
     SendRequestMessage(request, null, null, action, null);
 }
        private static void SendInitiatorMessage(FileEntry entry, MessageInitiator initiator, MessageAction action, params string[] description)
        {
            // do not log actions in users folder
            if (entry == null || entry.RootFolderType == FolderType.USER) return;

            MessageService.Send(initiator, action, description);
        }
Beispiel #60
0
        private static void SendInitiatorMessage(HttpRequest request, string initiator, MessageAction action,
                                                 params string[] description)
        {
            if (sender == null)
            {
                return;
            }

            var message = MessageFactory.Create(request, initiator, action, description);

            if (!MessagePolicy.Check(message))
            {
                return;
            }

            sender.Send(message);
        }