canmove, Confirmed users, Bureaucrats and Sysops emeriti
3,628
edits
Line 198: | Line 198: | ||
* Peer is the peer the message is being sent to | * Peer is the peer the message is being sent to | ||
* username is the user the peer was from | * username is the user the peer was from | ||
==== File Transfer ==== | |||
''This part of the API only applies when the SPA advertises "spachannel" in its capabilities'' | |||
===== Sending a text message ===== | |||
This message can be sent either way. | |||
{topic: "message", {peer: <peer>, type: "file:new", message: {filename: <string>, size: <integer>, id: <integer>}} | |||
* Peer is the peer the message is being sent to | |||
* filename is the filename string | |||
* size is the size of the file | |||
* id is the identifier for this specific file transfer (e.g. will be different for different transfers of the same filename). | |||
===== Typing notifications ===== | |||
{topic: "message", {peer: <peer>, type: "file:chunk", message: {id: <integer>, chunk: <chunk>}} | |||
* Peer is the peer the message is being sent to | |||
* id is the identifier for this specific file transfer | |||
* chunk is the binary string for the file chunk | |||
=== Handling ICE Candidates === | === Handling ICE Candidates === |