Пример #1
0
        public override CoolQRouteMessage OnMessageReceived(CoolQScopeEventArgs scope)
        {
            var routeMsg = scope.RouteMessage;

            _routeMsg = routeMsg;
            _identity = (CoolQIdentity)_routeMsg.Identity;
            _plugins  = PluginManager.Current.Plugins.OfType <MessagePlugin>()
                        .Where(k => (k.MiddlewareConfig as BackendConfig)?.CanDisabled == true)
                        .Where(k => k.TargetAuthority != Authority.Root);
            if (!DisabledList.ContainsKey(_identity))
            {
                DisabledList.Add(_identity, new List <Guid>());
            }

            _disabled = DisabledList[_identity];

            if (_routeMsg.CurrentAuthority == Authority.Public && _routeMsg.MessageType == MessageType.Group)
            {
                return(_routeMsg.ToSource(DefaultReply.AdminOnly));
            }
            if (List)
            {
                return(ShowPluginList());
            }
            if (DisabledPlugin != null)
            {
                return(EnablePlugin());
            }
            if (EnabledPlugin != null)
            {
                return(DisablePlugin());
            }

            return(_routeMsg.ToSource(DefaultReply.ParamError));
        }
Пример #2
0
    public void Disable(string modObjectName, bool save = true)
    {
        if (IsEnabled(modObjectName))
        {
            DisabledList.Add(modObjectName);
            UpdateProfileSelection();

            if (save)
            {
                Save();
            }
        }
    }
Пример #3
0
    public void Disable(string modObjectName, bool save = true)
    {
        if (GetEnabledFlag(modObjectName) != EnableFlag.Disabled)
        {
            DisabledList.Add(modObjectName);

            ProfileManager.UpdateProfileSelection();

            if (save)
            {
                Save();
            }
        }
    }