···811811 maybe_instant = last_msg.localTime(&self.client.app.tz);
812812 }
813813814814- var first_iter = true;
815814 while (iter.next()) |msg| {
816816- defer first_iter = false;
817815 // Break if we have gone past the top of the screen
818816 if (row < 0) break;
819817···10081006 // Check if we should print a "last read" line. If the next message we will print is
10091007 // before the last_read, and this message is after the last_read then it is our border.
10101008 // Before
10111011- if (!first_iter and maybe_next_instant != null and maybe_instant != null) {
10091009+ if (maybe_next_instant != null and maybe_instant != null) {
10121010 const this = maybe_instant.?.unixTimestamp();
10131011 const next = maybe_next_instant.?.unixTimestamp();
10141012 if (this > self.last_read and next <= self.last_read) {
···20542052 channel.has_unread_highlight = has_highlight;
20552053 channel.has_unread = true;
20562054 }
20572057- }
20582058-20592059- // If we get a message from the current user mark the channel as
20602060- // read, since they must have just sent the message.
20612061- const sender: []const u8 = blk: {
20622062- const src = msg2.source() orelse break :blk "";
20632063- const l = std.mem.indexOfScalar(u8, src, '!') orelse
20642064- std.mem.indexOfScalar(u8, src, '@') orelse
20652065- src.len;
20662066- break :blk src[0..l];
20672067- };
20682068- if (std.mem.eql(u8, sender, client.nickname())) {
20692069- self.app.markSelectedChannelRead();
20552055+ // If we get a message from the current user mark the channel as
20562056+ // read, since they must have just sent the message.
20572057+ const sender: []const u8 = blk: {
20582058+ const src = msg2.source() orelse break :blk "";
20592059+ const l = std.mem.indexOfScalar(u8, src, '!') orelse
20602060+ std.mem.indexOfScalar(u8, src, '@') orelse
20612061+ src.len;
20622062+ break :blk src[0..l];
20632063+ };
20642064+ if (std.mem.eql(u8, sender, client.nickname())) {
20652065+ self.app.markSelectedChannelRead();
20662066+ }
20702067 }
20712068 },
20722069 }