From 7c1b9f0a09af14c1d790d5b5f8d4ee8ebc215380 Mon Sep 17 00:00:00 2001 From: Coin Okay Date: Sat, 2 May 2020 07:31:45 -0500 Subject: refactor for granolin 0.1 - Implemented hardcopy-plist method. - Added known-users slot - Updated user managment to use known-users slot --- adminbot.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/adminbot.lisp b/adminbot.lisp index bb2c313..a0b6708 100644 --- a/adminbot.lisp +++ b/adminbot.lisp @@ -8,19 +8,22 @@ ((registration-shared-secret :accessor registration-shared-secret :initarg :registration-shared-secret + :initform nil) + (known-users + :accessor known-users :initform nil))) (defvar *adminbot* nil) -(defun get-known-users (client) - (getf (granolin::memory client) 'users-with-sent-invitations)) +(defmethod hardcopy-plist ((bot adminbot)) + (list 'registration-shared-secret (registration-shared-secret bot) + 'known-users (known-users bot))) (defun add-to-known-users (username client) - (setf (getf (granolin::memory client) 'users-with-sent-invitations) - (cons username (get-known-users client)))) + (push username (known-users client))) (defun has-sent-invitation-p (username client) - (member username (get-known-users client) :test #'string=)) + (member username (known-users client) :test #'string-equal)) (defparameter *no-invites-message* (format nil "~a ~a ~a" -- cgit v1.2.3