private async Task OnDiscoResponseMessage(DiscoResponseMessage disco, CheckDiscoFeaturesAsync action, string discoTarget)
        {
            // Print a list of all supported features:
            if (Logger.logLevel >= LogLevel.DEBUG)
            {
                StringBuilder sb = new StringBuilder("The server for '");
                sb.Append(CONNECTION.account.getBareJid());
                sb.Append("' supports the following features:\n");
                foreach (string s in disco.FEATURES.Select(x => x.VAR))
                {
                    sb.Append(s);
                    sb.Append("\n");
                }
                Logger.Debug(sb.ToString());
            }

            switch (disco.DISCO_TYPE)
            {
            case DiscoType.ITEMS:
                break;

            case DiscoType.INFO:
                await action(disco.FEATURES, discoTarget);

                break;

            default:
                break;
            }
        }
        private async Task DiscoAsync(string discoTarget, CheckDiscoFeaturesAsync action)
        {
            MessageResponseHelperResult <IQMessage> result = await CONNECTION.GENERAL_COMMAND_HELPER.discoAsync(discoTarget, DiscoType.INFO);

            if (result.STATE != MessageResponseHelperResultState.SUCCESS)
            {
                Logger.Error("Failed to perform server DISCO for '" + CONNECTION.account.getBareJid() + "' - " + result.STATE);
            }
            else if (result.RESULT is IQErrorMessage errorMessage)
            {
                Logger.Error("Failed to perform server DISCO for '" + CONNECTION.account.getBareJid() + "' - " + errorMessage.ERROR_OBJ.ToString());
            }
            // Success:
            else if (result.RESULT is DiscoResponseMessage disco)
            {
                await OnDiscoResponseMessage(disco, action, discoTarget);

                return;
            }
            else
            {
                Logger.Error("Failed to perform server DISCO for '" + CONNECTION.account.getBareJid() + "' - invalid response.");
            }

            CONNECTION.account.CONNECTION_INFO.msgCarbonsState = MessageCarbonsState.ERROR;
            CONNECTION.account.CONNECTION_INFO.pushState       = PushState.ERROR;
        }