summaryrefslogtreecommitdiff
path: root/tests/chat.ur
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chat.ur')
-rw-r--r--tests/chat.ur11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/chat.ur b/tests/chat.ur
index 2d79cd00..b982836d 100644
--- a/tests/chat.ur
+++ b/tests/chat.ur
@@ -25,7 +25,15 @@ fun chat id =
logTail <- source logHead;
let
- fun join () = subscribe ch
+ fun getCh () =
+ r <- oneRow (SELECT t.Chan FROM t WHERE t.Id = {[id]});
+ case r.T.Chan of
+ None => error <xml>Channel disappeared</xml>
+ | Some ch => return ch
+
+ fun join () =
+ ch <- getCh ();
+ subscribe ch
fun onload () =
let
@@ -42,6 +50,7 @@ fun chat id =
end
fun speak line =
+ ch <- getCh ();
send ch line
fun doSpeak () =