From 5a77df7cc50d08b9103dbc712361f24fea95c2d1 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 4 Jan 2022 12:30:57 +0100 Subject: [PATCH] document window.webxdc.selfName() --- draft/webxdc-user-guide.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/draft/webxdc-user-guide.md b/draft/webxdc-user-guide.md index e08d19356..218da5f41 100644 --- a/draft/webxdc-user-guide.md +++ b/draft/webxdc-user-guide.md @@ -66,6 +66,7 @@ and also incorporate updates that may have arrived while the app was not running eg. `[{payload: "foo"},{payload: "bar"}]` if `webxdc.sendUpdate("foo"); webxdc.sendUpdate("bar");` was called on the last run. + ### selfAddr() ``` @@ -78,6 +79,17 @@ just send the address along with the payload, and, if needed, compare the payload addresses against selfAddr() later on. +### selfName() + +``` +addr = window.webxdc.selfName() +``` + +Returns the peer's own name. +This is name chosen by the user in their settings, +if there is nothing set, that defaults to the peer's address. + + ## Webxdc Example The following example shows an input field and every input is show on all peers.