typing: refresh every 2s
This commit is contained in:
1 parent
bf40b50f52
commit
b958eaab4c
1 file changed
+3
-3
@@ -164,10 +164,10 @@ fn typingKeepalive() void {
|
|||||||
const io = typing_io orelse return;
|
const io = typing_io orelse return;
|
||||||
const pa = std.heap.page_allocator;
|
const pa = std.heap.page_allocator;
|
||||||
while (turn_busy.load(.acquire)) {
|
while (turn_busy.load(.acquire)) {
|
||||||
matrix.setTyping(pa, io, typing_token, typing_uid, typing_room, true, 60000);
|
matrix.setTyping(pa, io, typing_token, typing_uid, typing_room, true, 10000);
|
||||||
var slept: u32 = 0;
|
var slept: u32 = 0;
|
||||||
while (slept < 45_000 and turn_busy.load(.acquire)) : (slept += 500) {
|
while (slept < 2_000 and turn_busy.load(.acquire)) : (slept += 250) {
|
||||||
io.sleep(.{ .nanoseconds = 500 * std.time.ns_per_ms }, .real) catch {};
|
io.sleep(.{ .nanoseconds = 250 * std.time.ns_per_ms }, .real) catch {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
matrix.setTyping(pa, io, typing_token, typing_uid, typing_room, false, 0);
|
matrix.setTyping(pa, io, typing_token, typing_uid, typing_room, false, 0);
|
||||||
|
|||||||
Reference in new issue
Block a user