summaryrefslogtreecommitdiff
path: root/core/Messages.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Messages.zig')
-rw-r--r--core/Messages.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/Messages.zig b/core/Messages.zig
index de10b845..767eb297 100644
--- a/core/Messages.zig
+++ b/core/Messages.zig
@@ -111,9 +111,11 @@ pub const Message = struct {
}
pub fn stamp(buf: []u8, verb: []const u8, subject: []const u8) []const u8 {
- // The time of day as the session that said it read it, in its
- // zone: a replica's clock and TZ are its own (core/tape.zig).
- const clock = pardes.tape.value(.clock, timeOfDay, .{});
+ // The time of day of the host that stamps it, in its zone: only a
+ // host stamps a message (a file reloaded, a save, a language
+ // server's status), between steps, and the message it then hands
+ // the core (`setMessage`, an input) is what the tape carries.
+ const clock = timeOfDay();
const head = std.fmt.bufPrint(buf, "{s} {s} ", .{ &clock, verb }) catch return buf[0..0];
const room = buf.len - head.len;
const tail = if (subject.len <= room) subject else subject[subject.len - room ..];
@@ -161,7 +163,7 @@ fn showMessage(p: *Pardes, id: usize, text: []const u8, stack: bool) void {
pane.msg_len = @intCast(n);
// The clock when it was said (the session clock is the last pump's,
// and a 9P write after an idle hour would say it an hour ago).
- pane.msg_said_ms = pardes.tape.value(.clock, nowMs, .{});
+ pane.msg_said_ms = p.tape.value(.clock, nowMs, .{});
p.needs_frame = true;
// New, the same line again or a status update: fresh, so it stays.
pane.msg_life = .{};
@@ -185,7 +187,7 @@ fn nowMs() i64 {
pub fn expireUnattended(p: *Pardes) void {
if (!p.unattended) return;
// The clock as the session that recorded read it (core/tape.zig).
- const now = pardes.tape.value(.clock, nowMs, .{});
+ const now = p.tape.value(.clock, nowMs, .{});
for (p.panes) |slot| {
const pane = slot orelse continue;
if (pane.msg_len == 0 and pane.msg_older_len == 0) continue;