Skip to content

Commit c6b9d99

Browse files
committed
bump to 1.1.4
1 parent 1ca9b63 commit c6b9d99

File tree

7 files changed

+34
-24
lines changed

7 files changed

+34
-24
lines changed

crates/restsend-wasm/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,14 @@
498498
},
499499

500500
onTopicMessage: function (topicId, req) {
501+
let hasRead = false
502+
let unreadCountable = req.content?.unreadable !== true
501503
if (this.conversation) {
502504
if (topicId == this.conversation.topicId) {
503-
// set read
504-
return true
505+
hasRead = true
505506
}
506507
}
507-
return false
508+
return { hasRead, unreadCountable }
508509
},
509510
doMute: function (conversation) {
510511
conversation.mute = !conversation.mute

crates/restsend-wasm/src/callback.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,14 +460,17 @@ impl Client {
460460
/// * `topicId` String - The topic id
461461
/// * `message` ChatRequest - The message
462462
/// # Return
463-
/// * `true` - If return true, will send `has read` to server
463+
/// * `hasRead` Boolean - If return true, will send `has read` to server
464+
/// * `unreadCountable` Boolean - If return true, will increase unread count
464465
/// # Example
465466
/// ```javascript
466467
/// const client = new Client(info);
467468
/// await client.connect();
468469
/// client.ontopicmessage = (topicId, message) => {
469470
/// console.log(topicId, message);
470-
/// return true;
471+
/// let hasRead = true;
472+
/// let unreadCountable = message.content?.unreadable !== true
473+
/// return {hasRead, unreadCountable};
471474
/// }
472475
/// ```
473476
#[wasm_bindgen(setter)]

crates/restsend/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "restsend-sdk"
3-
version = "1.1.3"
3+
version = "1.1.4"
44
edition = "2021"
55

66
[lib]
@@ -21,7 +21,7 @@ wasm-bindgen-futures = "0.4.49"
2121
tokio-util = "0.7.13"
2222
lazy_static = "1.5.0"
2323
include_dir = "0.7.4"
24-
lru = "0.13.0"
24+
lru = "0.14.0"
2525
serde_json = "1.0.133"
2626
serde = { version = "1.0.215", features = ["derive"] }
2727
log = "0.4.22"

js/restsend_wasm.d.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,14 +660,17 @@ export class Client {
660660
* * `topicId` String - The topic id
661661
* * `message` ChatRequest - The message
662662
* # Return
663-
* * `true` - If return true, will send `has read` to server
663+
* * `hasRead` Boolean - If return true, will send `has read` to server
664+
* * `unreadCountable` Boolean - If return true, will increase unread count
664665
* # Example
665666
* ```javascript
666667
* const client = new Client(info);
667668
* await client.connect();
668669
* client.ontopicmessage = (topicId, message) => {
669670
* console.log(topicId, message);
670-
* return true;
671+
* let hasRead = true;
672+
* let unreadCountable = message.content?.unreadable !== true
673+
* return {hasRead, unreadCountable};
671674
* }
672675
* ```
673676
*/
@@ -844,8 +847,8 @@ export interface InitOutput {
844847
readonly __wbindgen_export_4: WebAssembly.Table;
845848
readonly __wbindgen_export_5: WebAssembly.Table;
846849
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
847-
readonly closure579_externref_shim: (a: number, b: number, c: any) => void;
848-
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha35824716486fd14: (a: number, b: number) => void;
850+
readonly closure582_externref_shim: (a: number, b: number, c: any) => void;
851+
readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h387baaa87c379092: (a: number, b: number) => void;
849852
readonly closure838_externref_shim: (a: number, b: number, c: any) => void;
850853
readonly closure879_externref_shim: (a: number, b: number, c: any, d: any) => void;
851854
readonly __wbindgen_start: () => void;

js/restsend_wasm.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ export function setLogging(level) {
271271
}
272272

273273
function __wbg_adapter_54(arg0, arg1, arg2) {
274-
wasm.closure579_externref_shim(arg0, arg1, arg2);
274+
wasm.closure582_externref_shim(arg0, arg1, arg2);
275275
}
276276

277277
function __wbg_adapter_57(arg0, arg1) {
278-
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha35824716486fd14(arg0, arg1);
278+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h387baaa87c379092(arg0, arg1);
279279
}
280280

281281
function __wbg_adapter_66(arg0, arg1, arg2) {
@@ -1441,14 +1441,17 @@ export class Client {
14411441
* * `topicId` String - The topic id
14421442
* * `message` ChatRequest - The message
14431443
* # Return
1444-
* * `true` - If return true, will send `has read` to server
1444+
* * `hasRead` Boolean - If return true, will send `has read` to server
1445+
* * `unreadCountable` Boolean - If return true, will increase unread count
14451446
* # Example
14461447
* ```javascript
14471448
* const client = new Client(info);
14481449
* await client.connect();
14491450
* client.ontopicmessage = (topicId, message) => {
14501451
* console.log(topicId, message);
1451-
* return true;
1452+
* let hasRead = true;
1453+
* let unreadCountable = message.content?.unreadable !== true
1454+
* return {hasRead, unreadCountable};
14521455
* }
14531456
* ```
14541457
* @param {any} cb
@@ -2325,7 +2328,7 @@ function __wbg_get_imports() {
23252328
imports.wbg.__wbg_setRequestHeader_51d371ad5196f6ef = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
23262329
arg0.setRequestHeader(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
23272330
}, arguments) };
2328-
imports.wbg.__wbg_setTimeout_c240977f76e6405e = function(arg0, arg1) {
2331+
imports.wbg.__wbg_setTimeout_381f79b557cf52f0 = function(arg0, arg1) {
23292332
setTimeout(arg0, arg1 >>> 0);
23302333
};
23312334
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
@@ -2529,23 +2532,23 @@ function __wbg_get_imports() {
25292532
return ret;
25302533
};
25312534
imports.wbg.__wbindgen_closure_wrapper1088 = function(arg0, arg1, arg2) {
2532-
const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_54);
2535+
const ret = makeMutClosure(arg0, arg1, 579, __wbg_adapter_54);
25332536
return ret;
25342537
};
25352538
imports.wbg.__wbindgen_closure_wrapper1089 = function(arg0, arg1, arg2) {
2536-
const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_57);
2539+
const ret = makeMutClosure(arg0, arg1, 579, __wbg_adapter_57);
25372540
return ret;
25382541
};
25392542
imports.wbg.__wbindgen_closure_wrapper1090 = function(arg0, arg1, arg2) {
2540-
const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_54);
2543+
const ret = makeMutClosure(arg0, arg1, 579, __wbg_adapter_54);
25412544
return ret;
25422545
};
2543-
imports.wbg.__wbindgen_closure_wrapper1091 = function(arg0, arg1, arg2) {
2544-
const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_54);
2546+
imports.wbg.__wbindgen_closure_wrapper1092 = function(arg0, arg1, arg2) {
2547+
const ret = makeMutClosure(arg0, arg1, 579, __wbg_adapter_54);
25452548
return ret;
25462549
};
25472550
imports.wbg.__wbindgen_closure_wrapper1094 = function(arg0, arg1, arg2) {
2548-
const ret = makeMutClosure(arg0, arg1, 580, __wbg_adapter_54);
2551+
const ret = makeMutClosure(arg0, arg1, 579, __wbg_adapter_54);
25492552
return ret;
25502553
};
25512554
imports.wbg.__wbindgen_closure_wrapper2255 = function(arg0, arg1, arg2) {

js/restsend_wasm_bg.wasm

14 Bytes
Binary file not shown.

js/restsend_wasm_bg.wasm.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export const __externref_table_alloc: () => number;
102102
export const __wbindgen_export_4: WebAssembly.Table;
103103
export const __wbindgen_export_5: WebAssembly.Table;
104104
export const __wbindgen_free: (a: number, b: number, c: number) => void;
105-
export const closure579_externref_shim: (a: number, b: number, c: any) => void;
106-
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha35824716486fd14: (a: number, b: number) => void;
105+
export const closure582_externref_shim: (a: number, b: number, c: any) => void;
106+
export const _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h387baaa87c379092: (a: number, b: number) => void;
107107
export const closure838_externref_shim: (a: number, b: number, c: any) => void;
108108
export const closure879_externref_shim: (a: number, b: number, c: any, d: any) => void;
109109
export const __wbindgen_start: () => void;

0 commit comments

Comments
 (0)