Permalink
Browse files

[fix] chat: Fixing chat relied to the previous commit (history signat…

…ure has been changed)
  • Loading branch information...
1 parent 2426482 commit f0e6b7cba7588b390c7ecbb738b3cb881d87755c @BourgerieQuentin committed Dec 15, 2011
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/examples/pubnub_chat.opa
@@ -26,16 +26,15 @@ broadcast(author, msg) =
do PubNub.publish("chat", record_json)
Dom.clear_value(#entry)
-add_history(x: string) =
- match Json.deserialize(x) with
- | {some={List=history}} ->
- do List.iter(user_update_2, history)
- void
- | _ -> void
+add_history(history) =
+ LowLevelArray.iter(
+ elt -> user_update_2(Json.deserialize(elt) ? {String = elt})
+ , history
+ )
launch(author) =
init_client() =
- //do PubNub.history("chat", 20, (h -> add_history(h)))
+ do PubNub.history("chat", 20, (h -> add_history(h)))
PubNub.subscribe("chat", (x -> user_update(x)))
send_message() =
broadcast(author, Dom.get_value(#entry))

0 comments on commit f0e6b7c

Please sign in to comment.