mirror of
				https://gitlab.com/MrFry/mrfrys-node-server
				synced 2025-04-01 20:24:18 +02:00 
			
		
		
		
	Logging fix
This commit is contained in:
		@@ -113,7 +113,7 @@ function LogReq(
 | 
			
		||||
    if (req.url.includes('lred')) {
 | 
			
		||||
      dl += C('red')
 | 
			
		||||
    }
 | 
			
		||||
    if (!shouldLog(req.session.user.id, noLogIds)) {
 | 
			
		||||
    if (req.session && req.session.user && !shouldLog(req.session.user.id, noLogIds)) {
 | 
			
		||||
      return
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -225,14 +225,13 @@ function Load(): void {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function shouldLog(userId: string | number, nolog: string[]): boolean {
 | 
			
		||||
  return nolog.some((noLogId) => {
 | 
			
		||||
  return !nolog.some((noLogId) => {
 | 
			
		||||
    return noLogId === userId.toString()
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function LogStat(url: string, hostname: string, userId: number | string): void {
 | 
			
		||||
  const nolog = shouldLog(userId, noLogIds)
 | 
			
		||||
  if (nolog) {
 | 
			
		||||
  if (!shouldLog(userId, noLogIds)) {
 | 
			
		||||
    return
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user