From 7ec3ff9cacc2a3fde35fcafe8f0fc004e95fdebe Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Wed, 19 Feb 2020 16:57:50 -0700 Subject: [PATCH] Minor cleanup --- src/forum.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/forum.nim b/src/forum.nim index aee5ad4..70baf54 100644 --- a/src/forum.nim +++ b/src/forum.nim @@ -151,7 +151,7 @@ proc checkLoggedIn(c: TForumData) = ) c.previousVisitAt = personRow[1].parseInt let diff = getTime() - fromUnix(personRow[0].parseInt) - if diff.minutes > 30: + if diff.inMinutes > 30: c.previousVisitAt = personRow[0].parseInt db.exec( sql""" @@ -238,7 +238,7 @@ proc verifyIdentHash( let newIdent = makeIdentHash(name, row[0], epoch, row[1]) # Check that it hasn't expired. let diff = getTime() - epoch.fromUnix() - if diff.hours > 2: + if diff.inHours > 2: raise newForumError("Link expired") if newIdent != ident: raise newForumError("Invalid ident hash") @@ -498,7 +498,7 @@ proc updatePost(c: TForumData, postId: int, content: string, # Verify that the current user has permissions to edit the specified post. let creation = fromUnix(postRow[1].parseInt) - let isArchived = (getTime() - creation).weeks > 8 + let isArchived = (getTime() - creation).inWeeks > 8 let canEdit = c.rank == Admin or c.userid == postRow[0] if isArchived: raise newForumError("This post is archived and can no longer be edited")