|
|
@@ -271,15 +271,19 @@
|
|
|
|
|
|
(defun process-latest-checkins ()
|
|
|
(handler-case
|
|
|
- (dolist (checkin (fsq-fetch-new-checkins))
|
|
|
- (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)
|
|
|
- (log:info "Sending checkin" chat-id (fsq-format-checkin checkin))
|
|
|
- (telegram-send-message chat-id (fsq-format-checkin checkin))))
|
|
|
- (push id *fsq-seen-ids*))))
|
|
|
+ (let ((checkins (make-hash-table)))
|
|
|
+ (dolist (checkin (fsq-fetch-new-checkins))
|
|
|
+ (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)
|
|
|
+ (push (fsq-format-checkin checkin)
|
|
|
+ (gethash chat-id checkins))))
|
|
|
+ (push id *fsq-seen-ids*))))
|
|
|
+ (loop for chat-id being the hash-keys in checkins using (hash-value texts)
|
|
|
+ do (log:info "Sending checkins" chat-id texts)
|
|
|
+ (telegram-send-message chat-id (format nil "~{~A~^~%~}" texts))))
|
|
|
(error (e) (log:error e))))
|
|
|
|
|
|
|