mirror of https://codeberg.org/cage/tinmop/
- ensured an user is added into the the database before following them.
This commit is contained in:
parent
185ec6aa3b
commit
9efb99b234
|
@ -799,7 +799,9 @@
|
||||||
username))
|
username))
|
||||||
remote-accounts-matching)))
|
remote-accounts-matching)))
|
||||||
(values (tooter:id matched-account)
|
(values (tooter:id matched-account)
|
||||||
username)))
|
username
|
||||||
|
matched-account)))
|
||||||
|
|
||||||
|
|
||||||
(defmacro with-process-follower ((username user-id
|
(defmacro with-process-follower ((username user-id
|
||||||
&optional
|
&optional
|
||||||
|
@ -819,9 +821,15 @@
|
||||||
(defmethod process-event ((object follow-user-event))
|
(defmethod process-event ((object follow-user-event))
|
||||||
(with-accessors ((username payload)) object
|
(with-accessors ((username payload)) object
|
||||||
(with-process-follower (username user-id db:all-unfollowed-usernames)
|
(with-process-follower (username user-id db:all-unfollowed-usernames)
|
||||||
(client:follow-user user-id)
|
(let ((user-object (nth-value 2 (find-user-id-from-exact-acct username))))
|
||||||
(db:add-to-followers user-id)
|
(if user-object
|
||||||
(ui:notify (format nil (_ "Followed ~a") username)))))
|
(progn
|
||||||
|
(db:update-db user-object)
|
||||||
|
(client:follow-user user-id)
|
||||||
|
(db:add-to-followers user-id)
|
||||||
|
(ui:notify (format nil (_ "Followed ~a") username)))
|
||||||
|
(ui:notify (format nil (_ "User ~a not found on the server") username)
|
||||||
|
:as-error t))))))
|
||||||
|
|
||||||
(defclass unfollow-user-event (program-event) ())
|
(defclass unfollow-user-event (program-event) ())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue