Skip to content

Commit 9efb99b

Browse files
author
cage
committed
- ensured an user is added into the the database before following them.
1 parent 185ec6a commit 9efb99b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/program-events.lisp

+12-4
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,9 @@
799799
username))
800800
remote-accounts-matching)))
801801
(values (tooter:id matched-account)
802-
username)))
802+
username
803+
matched-account)))
804+
803805

804806
(defmacro with-process-follower ((username user-id
805807
&optional
@@ -819,9 +821,15 @@
819821
(defmethod process-event ((object follow-user-event))
820822
(with-accessors ((username payload)) object
821823
(with-process-follower (username user-id db:all-unfollowed-usernames)
822-
(client:follow-user user-id)
823-
(db:add-to-followers user-id)
824-
(ui:notify (format nil (_ "Followed ~a") username)))))
824+
(let ((user-object (nth-value 2 (find-user-id-from-exact-acct username))))
825+
(if user-object
826+
(progn
827+
(db:update-db user-object)
828+
(client:follow-user user-id)
829+
(db:add-to-followers user-id)
830+
(ui:notify (format nil (_ "Followed ~a") username)))
831+
(ui:notify (format nil (_ "User ~a not found on the server") username)
832+
:as-error t))))))
825833

826834
(defclass unfollow-user-event (program-event) ())
827835

0 commit comments

Comments
 (0)