Example #1
0
        private string GetLogFile()
        {
            if (_ProtocolManager == null)
            {
                return(null);
            }

            var logPath  = Platform.LogPath;
            var protocol = _ProtocolManager.Protocol.ToLower();
            var network  = _ProtocolManager.NetworkID.ToLower();

            logPath = Path.Combine(logPath, protocol);
            if (network != protocol)
            {
                logPath = Path.Combine(logPath, network);
            }
            logPath = IOSecurity.GetFilteredPath(logPath);
            if (!Directory.Exists(logPath))
            {
                Directory.CreateDirectory(logPath);
            }

            var chatId = IOSecurity.GetFilteredFileName(ID.ToLower());

            logPath = Path.Combine(logPath, String.Format("{0}.log", chatId));
            return(logPath);
        }
Example #2
0
        protected string GetBufferPath()
        {
            var path     = Platform.GetBuffersPath(SessionUsername);
            var protocol = Protocol.ToLower();
            var network  = NetworkID.ToLower();

            path = Path.Combine(path, protocol);
            if (network != protocol)
            {
                path = Path.Combine(path, network);
            }
            path = IOSecurity.GetFilteredPath(path);
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            var chatId = IOSecurity.GetFilteredFileName(ChatID.ToLower());

            return(Path.Combine(path, chatId));
        }
Example #3
0
        string GetDatabaseFile()
        {
            var dbPath   = Platform.GetBuffersPath(SessionUsername);
            var protocol = Protocol.ToLower();
            var network  = NetworkID.ToLower();

            dbPath = Path.Combine(dbPath, protocol);
            if (network != protocol)
            {
                dbPath = Path.Combine(dbPath, network);
            }
            dbPath = IOSecurity.GetFilteredPath(dbPath);
            if (!Directory.Exists(dbPath))
            {
                Directory.CreateDirectory(dbPath);
            }

            var chatId = IOSecurity.GetFilteredFileName(ChatID.ToLower());

            dbPath = Path.Combine(dbPath, String.Format("{0}.db4o", chatId));
            return(dbPath);
        }