mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2026-08-29 05:21:42 -06:00
- #100 add documentation for new typing node and update README
- #100 fix typing event causing server error due to number being string - Mention using pantalaimon as an alternative for E2EE support in README
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
roomType: { value: "msg" },
|
||||
roomValue: { value: "topic" },
|
||||
typingType: { value: "bool" },
|
||||
typingValue: { value: true },
|
||||
typingValue: { value: "true" },
|
||||
timeoutMsType: { value: "num" },
|
||||
timeoutMsValue: { value: 20000 },
|
||||
},
|
||||
@@ -74,6 +74,10 @@
|
||||
<label for="node-input-room"><i class="fa fa-clock-o"></i> Timeout Milliseconds</label>
|
||||
<input type="text" id="node-input-timeoutMs">
|
||||
</div>
|
||||
|
||||
<div class="form-row form-tips">
|
||||
Timeout MS is how many milliseconds the server should show the user typing for.
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="matrix-typing">
|
||||
|
||||
@@ -33,6 +33,7 @@ module.exports = function(RED) {
|
||||
node.on('input', async function(msg) {
|
||||
if (! node.server || ! node.server.matrixClient) {
|
||||
node.error("No matrix server selected", msg);
|
||||
node.send([null, msg]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -54,6 +55,8 @@ module.exports = function(RED) {
|
||||
}
|
||||
} else if(type === "bool") {
|
||||
value = (property === 'true');
|
||||
} else if(type === "num") {
|
||||
value = Number(property);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -68,7 +71,6 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("sending typing",roomId, typing, timeoutMs);
|
||||
await node.server.matrixClient.sendTyping(roomId, typing, timeoutMs);
|
||||
node.send([msg, null]);
|
||||
} catch(e) {
|
||||
|
||||
Reference in New Issue
Block a user