@f3liz/rescript-misskey-api 0.6.7 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es6/src/stream/StreamClient.mjs +2 -2
- package/package.json +1 -1
- package/src/bindings/{WebSocket.res → MisskeyWebSocket.res} +1 -1
- package/src/stream/NativeStreamBindings.res +2 -2
- package/src/stream/StreamClient.res +1 -1
- /package/lib/es6/src/bindings/{WebSocket.mjs → MisskeyWebSocket.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as WebSocket from "../bindings/WebSocket.mjs";
|
|
4
3
|
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
5
4
|
import * as StreamProtocol from "./StreamProtocol.mjs";
|
|
5
|
+
import * as MisskeyWebSocket from "../bindings/MisskeyWebSocket.mjs";
|
|
6
6
|
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
7
7
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
8
8
|
import * as StreamConnection from "./StreamConnection.mjs";
|
|
@@ -106,7 +106,7 @@ function make(origin, credential, param) {
|
|
|
106
106
|
|
|
107
107
|
function send(stream, msg) {
|
|
108
108
|
let serialized = StreamProtocol.serializeOutgoing(msg);
|
|
109
|
-
if (
|
|
109
|
+
if (MisskeyWebSocket.isOpen(stream.ws) && stream.pendingMessages.length === 0) {
|
|
110
110
|
stream.ws.send(serialized);
|
|
111
111
|
} else {
|
|
112
112
|
stream.pendingMessages = stream.pendingMessages.concat([serialized]);
|
package/package.json
CHANGED
|
@@ -40,11 +40,11 @@ let sendTyped = (stream: stream, type_: string, payload: JSON.t): unit => {
|
|
|
40
40
|
let obj = Dict.make()
|
|
41
41
|
obj->Dict.set("type", type_->JSON.Encode.string)
|
|
42
42
|
obj->Dict.set("body", payload)
|
|
43
|
-
stream.ws->
|
|
43
|
+
stream.ws->MisskeyWebSocket.send(obj->JSON.Encode.object->JSON.stringify)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
let sendRaw = (stream: stream, payload: JSON.t): unit => {
|
|
47
|
-
stream.ws->
|
|
47
|
+
stream.ws->MisskeyWebSocket.send(payload->JSON.stringify)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// Connection management
|
|
File without changes
|