an experimental irc client

ui: fix redrawing due to typing status change

rockorager.dev 67f8bdc5 4dfd8427

verified
+7 -4
comlink.perf

This is a binary file and will not be displayed.

spunky.perf

This is a binary file and will not be displayed.

+7 -4
src/irc.zig
··· 1884 1884 // if the last typing status received is more than 6 seconds ago. In this case, we set the last 1885 1885 // typing time to 0 and redraw. 1886 1886 pub fn checkTypingStatus(self: *Client, ctx: *vxfw.EventContext) void { 1887 + // We only care about typing tags if we have the message-tags cap 1888 + if (!self.caps.@"message-tags") return; 1887 1889 const now: u32 = @intCast(std.time.timestamp()); 1888 1890 for (self.channels.items) |channel| { 1889 - if (channel.typing_last_active > 0 and 1890 - channel.typing_last_active + 6 >= now) continue; 1891 - channel.typing_last_active = 0; 1892 - ctx.redraw = true; 1891 + // If the last_active is set, and it is more than 6 seconds ago, we will redraw 1892 + if (channel.typing_last_active != 0 and channel.typing_last_active + 6 < now) { 1893 + channel.typing_last_active = 0; 1894 + ctx.redraw = true; 1895 + } 1893 1896 } 1894 1897 } 1895 1898