-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
84 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,17 +230,25 @@ xmpp.send(xml("presence")).catch(console.error); | |
|
||
Returns a promise that resolves once the stanza is serialized and written to the socket or rejects if any of those fails. | ||
|
||
You can also pass multiple stanzas. Here is an example sending the same text message to multiple recipients. | ||
### sendMultiple | ||
|
||
Sends multiple stanzas. | ||
|
||
Here is an example sending the same text message to multiple recipients. | ||
|
||
```js | ||
const message = "Hello"; | ||
const recipients = ["[email protected]", "[email protected]"]; | ||
const stanzas = recipients.map((address) => | ||
xml("message", { to: address, type: "chat" }, xml("body", null, message)), | ||
); | ||
xmpp.send(...stanzas).catch(console.error); | ||
xmpp.sendMultiple(stanzas).catch(console.error); | ||
``` | ||
|
||
Returns a promise that resolves once all the stanzas have been sent. | ||
|
||
If you need to send a stanza to multiple recipients we recommend using [Extended Stanza Addressing](https://xmpp.org/extensions/xep-0033.html) instead. | ||
|
||
### xmpp.reconnect | ||
|
||
See [@xmpp/reconnect](/packages/reconnect). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,17 +200,25 @@ xmpp.send(xml("presence")).catch(console.error); | |
|
||
Returns a promise that resolves once the stanza is serialized and written to the socket or rejects if any of those fails. | ||
|
||
You can also pass multiple stanzas. Here is an example sending the same text message to multiple recipients. | ||
### sendMultiple | ||
|
||
Sends multiple stanzas. | ||
|
||
Here is an example sending the same text message to multiple recipients. | ||
|
||
```js | ||
const message = "Hello"; | ||
const recipients = ["[email protected]", "[email protected]"]; | ||
const stanzas = recipients.map((address) => | ||
xml("message", { to: address, type: "chat" }, xml("body", null, message)), | ||
); | ||
xmpp.send(...stanzas).catch(console.error); | ||
xmpp.sendMultiple(stanzas).catch(console.error); | ||
``` | ||
|
||
Returns a promise that resolves once all the stanzas have been sent. | ||
|
||
If you need to send a stanza to multiple recipients we recommend using [Extended Stanza Addressing](https://xmpp.org/extensions/xep-0033.html) instead. | ||
|
||
### xmpp.reconnect | ||
|
||
See [@xmpp/reconnect](/packages/reconnect). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters