[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 01/03: examples/web: Simplify and reduce the scope of th
From: |
gnunet |
Subject: |
[gnunet-scheme] 01/03: examples/web: Simplify and reduce the scope of the CADET form. |
Date: |
Thu, 28 Jul 2022 16:02:02 +0200 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit ab7ba75c8fb7921d86c7ab4e18bc33bc4652d3a9
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Thu Jul 28 14:08:32 2022 +0200
examples/web: Simplify and reduce the scope of the CADET form.
One step at a time, let's not write a whole chat system at once!
* examples/web.scm (cadet-start-chat-form): Reduce scope to only
sending a single message.
(url-handler)[/cadet-chat]: Likewise.
---
examples/web.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/examples/web.scm b/examples/web.scm
index 1bec531..3f2a995 100644
--- a/examples/web.scm
+++ b/examples/web.scm
@@ -98,13 +98,16 @@ for success is used."
(define cadet-start-chat-form
`(form
- (@ (action "/start-cadet-chat") (method "post"))
+ (@ (action "/cadet-chat") (method "post"))
(ul (li (label (@ (for "cadet-start-peer"))
"Identity of remote peer to connect to")
(input (@ (type "text") (id "cadet-start-peer") (name "peer"))))
(li (label (@ (for "cadet-port-name"))
"Name of the port to connect to (as a string)")
- (input (@ (type "text") (id "cadet-port-name") (name "port")))))
+ (input (@ (type "text") (id "cadet-port-name") (name "port"))))
+ (li (label (@ (for "cadet-message"))
+ "Message to send (text)")
+ (input (@ (type "text" (id "cadet-message") (name "message"))))))
(input (@ (type "submit") (value "Connect!")))))
(define (cadet-chat-forms)
@@ -238,12 +241,11 @@ merely a race?")))
(estimate->html current-estimate)
'(p "No etimate yet")))))
("/cadet-chat"
- (respond/html `(div (p "You can only connect to a chat here, not start
new ones")
+ (respond/html `(div (p "You can only send a message to an already
existing chat here,
+not start new chats or view conversation.")
(p "Run gnunet-cadet --open-port=PORT to run a new
chat!")
- (p "Connect to a chat!")
- ,cadet-start-chat-form
- (p "participate in a chat!")
- ,@(cadet-chat-forms))))
+ (p "Send a message to a chat!")
+ ,cadet-start-chat-form)))
("/search-dht" ; TODO check method and Content-Type, validation ...
(if (pk 'b body)
(process-search-dht dht-server (urlencoded->alist body))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.