示例#1
0
        private void ChannelDescriptionCommand(IDictionary <string, object> command)
        {
            var channel     = FindChannel(command);
            var description = command.Get("description");

            if (channel == null)
            {
                RequeueCommand(command);
                return;
            }

            var isInitializer = string.IsNullOrWhiteSpace(channel.Description);

            if (string.Equals(channel.Description, description, StringComparison.Ordinal))
            {
                return;
            }

            channel.Description = WebUtility.HtmlDecode(WebUtility.HtmlDecode(description));

            if (isInitializer)
            {
                return;
            }

            var args = new ChannelDescriptionChangedEventArgs();

            Events.NewChannelUpdate(channel, args);
        }
        private void ChannelDescriptionCommand(IDictionary<string, object> command)
        {
            lock (chatStateLocker)
            {
                var channel = FindChannel(command);
                var description = command.Get("description");

                if (channel == null)
                {
                    RequeueCommand(command);
                    return;
                }

                var isInitializer = string.IsNullOrWhiteSpace(channel.Description);

                if (string.Equals(channel.Description, description, StringComparison.Ordinal))
                    return;

                channel.Description = WebUtility.HtmlDecode(WebUtility.HtmlDecode(description));

                if (isInitializer)
                    return;

                var args = new ChannelDescriptionChangedEventArgs();
                Events.NewChannelUpdate(channel, args);
            }
        }