Skip to content

Commit d767576

Browse files
committed
backward compat: rename so that "undefined" means it is like before the two flags were introduced.
1 parent 7c3d53c commit d767576

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

src-docs/spec/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### New APIs
66

7-
- add `webxdc.appSenderAddr` and `webxdc.canSendUpdatesToAllPeers`
7+
- add `webxdc.appSenderAddr` and `webxdc.canOnlySendUpdatesToAppSender`
88
to allow apps to determine their role and their ability to send updates.
99
## [1.3] - 2026-02-11
1010

src-docs/spec/messenger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ When starting a web view for a webxdc app to run, messenger implementors
5454

5555
- MUST support `<meta name="viewport" ...>` is useful especially as webviews from different platforms have different defaults
5656

57-
- MUST support `window.webxdc.appSenderAddr` and `window.webxdc.canSendUpdatesToAllPeers`
57+
- MUST support `window.webxdc.appSenderAddr` and `window.webxdc.canOnlySendUpdatesToAppSender`
5858
to allow apps to determine their role and their ability to send updates.
5959

6060
- MUST support `<input type="file">` to allow importing of files;

src-docs/spec/selfAddr_and_selfName.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,22 @@ This supports a common development model where a "central" app instance
4545
(the sender's) processes all updates and distributes the resulting state
4646
back to all peers.
4747

48-
## canSendUpdatesToAllPeers
48+
## canOnlySendUpdatesToAppSender
4949

5050
```js
51-
window.webxdc.canSendUpdatesToAllPeers
51+
window.webxdc.canOnlySendUpdatesToAppSender
5252
```
5353

54-
`canSendUpdatesToAllPeers` is a boolean that is `true` if the local user
55-
can send [updates](./sendUpdate.md) to everyone in the chat.
56-
If it is `false`, updates sent by the local user will only be seen by the app sender.
54+
`canOnlySendUpdatesToAppSender` is a boolean that is `true` if updates sent
55+
by the local user will only be seen by the app sender.
56+
If it is `false` or `undefined`, the local user can send [updates](./sendUpdate.md) to everyone in the chat.
5757

5858
On some platforms, such as "broadcast channels," it is technically impossible
5959
for subscribers to discover or send updates to each other directly.
6060
In those cases, only the app sender can distribute updates globally.
6161

6262

63+
6364
## Example using selfAddr and selfName
6465

6566
Here is a simple chat app that sends out a reply using the display names

src-docs/spec/sendUpdate.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ window.webxdc.sendUpdate(update, descr);
55
```
66

77
Send an update to peers.
8-
If `webxdc.canSendUpdatesToAllPeers` is true, the update is sent to all peers.
9-
If `webxdc.canSendUpdatesToAllPeers` is false, the update is only sent to the app sender
8+
If `webxdc.canOnlySendUpdatesToAppSender` is false, the update is sent to all peers.
9+
If `webxdc.canOnlySendUpdatesToAppSender` is true, the update is only sent to the app sender
1010
(the peer with the address `webxdc.appSenderAddr`).
1111

12+
1213
All receiving peers, including the sending one,
1314
will receive the update by the callback given to [`setUpdateListener()`](./setUpdateListener.html).
1415

0 commit comments

Comments
 (0)