an experimental irc client

channel: only send MARKREAD if needed

+11 -8
+11 -8
src/irc.zig
··· 454 454 self.has_unread = false; 455 455 self.has_unread_highlight = false; 456 456 const last_msg = self.messages.getLastOrNull() orelse return; 457 - const time_tag = last_msg.getTag("time") orelse return; 458 - try self.client.print( 459 - "MARKREAD {s} timestamp={s}\r\n", 460 - .{ 461 - self.name, 462 - time_tag, 463 - }, 464 - ); 457 + const time = last_msg.time() orelse return; 458 + if (time.unixTimestamp() > self.last_read) { 459 + const time_tag = last_msg.getTag("time") orelse return; 460 + try self.client.print( 461 + "MARKREAD {s} timestamp={s}\r\n", 462 + .{ 463 + self.name, 464 + time_tag, 465 + }, 466 + ); 467 + } 465 468 } 466 469 467 470 pub fn contentWidget(self: *Channel) vxfw.Widget {