From b19c948b058a94a7b4f5de01b6642d0303ec214d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 3 Feb 2021 23:25:30 +0100 Subject: main: Replace hard-coded extension ID with list from command line args Reload the extension IDs given on the command line now that we have them from the `config` object. Replace the hard-coded extension ID that I had been using for testing. --- l/src/main.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'l/src') diff --git a/l/src/main.lisp b/l/src/main.lisp index caadfe3..9a0ea79 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -24,7 +24,9 @@ ;; TODO: error if no `socket-url` (with-websocket-connection (*client*) - (wsd:on :message *client* #'ws-on-message) + (wsd:on :message *client* + #'(lambda (message) + (ws-on-message message (extension-ids config)))) ; (wsd:on :message *client* #'(lambda (message) (ws-on-message message))) ;; TODO: Maybe defvar *config* and store client in the config @@ -32,13 +34,13 @@ (wait-group:wait *wg*)))) -(defun ws-on-message (message) +(defun ws-on-message (message extension-ids) (let* ((response (jsown:parse message)) (targets (parse-get-targets-response response))) (if targets (reload-extensions (extension-targets targets) - '("pacpdcpgfbpkdpmhfaljffnfbdanmblh"))) + extension-ids)) (if (target-attached-to-target-msg-p response) (reload-extension -- cgit v1.2.3