|
@@ -213,13 +213,18 @@
|
|
|
(telegram-send-message chat-id (format nil "Теперь палим ~A" user)))))
|
|
(telegram-send-message chat-id (format nil "Теперь палим ~A" user)))))
|
|
|
(setf (gethash chat-id *fsq-send-to*) users)))))
|
|
(setf (gethash chat-id *fsq-send-to*) users)))))
|
|
|
|
|
|
|
|
|
|
+(defvar *fsq-seen-ids* nil "Ids of seen checkins")
|
|
|
|
|
+
|
|
|
(defun process-latest-checkins ()
|
|
(defun process-latest-checkins ()
|
|
|
(handler-case
|
|
(handler-case
|
|
|
(dolist (checkin (fsq-fetch-new-checkins))
|
|
(dolist (checkin (fsq-fetch-new-checkins))
|
|
|
- (let ((user (aget "id" (aget "user" checkin))))
|
|
|
|
|
- (loop for chat-id being the hash-keys in *fsq-send-to* using (hash-value users)
|
|
|
|
|
- do (when (member user users :test #'equal)
|
|
|
|
|
- (telegram-send-message chat-id (fsq-format-checkin checkin))))))
|
|
|
|
|
|
|
+ (let ((id (aget "id" checkin))
|
|
|
|
|
+ (user (aget "id" (aget "user" checkin))))
|
|
|
|
|
+ (unless (find id *fsq-seen-ids* :test #'equal)
|
|
|
|
|
+ (loop for chat-id being the hash-keys in *fsq-send-to* using (hash-value users)
|
|
|
|
|
+ do (when (member user users :test #'equal)
|
|
|
|
|
+ (telegram-send-message chat-id (fsq-format-checkin checkin))))
|
|
|
|
|
+ (push id *fsq-seen-ids*))))
|
|
|
(error (e) (log:error e))))
|
|
(error (e) (log:error e))))
|
|
|
|
|
|
|
|
|
|
|