tangled
alpha
login
or
join now
rockorager.dev
/
comlink
2
fork
atom
an experimental irc client
2
fork
atom
overview
issues
pulls
pipelines
channel: only send MARKREAD if needed
rockorager.dev
1 year ago
67768059
e02f7dc2
+11
-8
1 changed file
expand all
collapse all
unified
split
src
irc.zig
+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
457
-
const time_tag = last_msg.getTag("time") orelse return;
458
458
-
try self.client.print(
459
459
-
"MARKREAD {s} timestamp={s}\r\n",
460
460
-
.{
461
461
-
self.name,
462
462
-
time_tag,
463
463
-
},
464
464
-
);
457
457
+
const time = last_msg.time() orelse return;
458
458
+
if (time.unixTimestamp() > self.last_read) {
459
459
+
const time_tag = last_msg.getTag("time") orelse return;
460
460
+
try self.client.print(
461
461
+
"MARKREAD {s} timestamp={s}\r\n",
462
462
+
.{
463
463
+
self.name,
464
464
+
time_tag,
465
465
+
},
466
466
+
);
467
467
+
}
465
468
}
466
469
467
470
pub fn contentWidget(self: *Channel) vxfw.Widget {