an experimental irc client

ui: skip the first_iter stuff

+13 -16
+13 -16
src/irc.zig
··· 811 811 maybe_instant = last_msg.localTime(&self.client.app.tz); 812 812 } 813 813 814 - var first_iter = true; 815 814 while (iter.next()) |msg| { 816 - defer first_iter = false; 817 815 // Break if we have gone past the top of the screen 818 816 if (row < 0) break; 819 817 ··· 1008 1006 // Check if we should print a "last read" line. If the next message we will print is 1009 1007 // before the last_read, and this message is after the last_read then it is our border. 1010 1008 // Before 1011 - if (!first_iter and maybe_next_instant != null and maybe_instant != null) { 1009 + if (maybe_next_instant != null and maybe_instant != null) { 1012 1010 const this = maybe_instant.?.unixTimestamp(); 1013 1011 const next = maybe_next_instant.?.unixTimestamp(); 1014 1012 if (this > self.last_read and next <= self.last_read) { ··· 2054 2052 channel.has_unread_highlight = has_highlight; 2055 2053 channel.has_unread = true; 2056 2054 } 2057 - } 2058 - 2059 - // If we get a message from the current user mark the channel as 2060 - // read, since they must have just sent the message. 2061 - const sender: []const u8 = blk: { 2062 - const src = msg2.source() orelse break :blk ""; 2063 - const l = std.mem.indexOfScalar(u8, src, '!') orelse 2064 - std.mem.indexOfScalar(u8, src, '@') orelse 2065 - src.len; 2066 - break :blk src[0..l]; 2067 - }; 2068 - if (std.mem.eql(u8, sender, client.nickname())) { 2069 - self.app.markSelectedChannelRead(); 2055 + // If we get a message from the current user mark the channel as 2056 + // read, since they must have just sent the message. 2057 + const sender: []const u8 = blk: { 2058 + const src = msg2.source() orelse break :blk ""; 2059 + const l = std.mem.indexOfScalar(u8, src, '!') orelse 2060 + std.mem.indexOfScalar(u8, src, '@') orelse 2061 + src.len; 2062 + break :blk src[0..l]; 2063 + }; 2064 + if (std.mem.eql(u8, sender, client.nickname())) { 2065 + self.app.markSelectedChannelRead(); 2066 + } 2070 2067 } 2071 2068 }, 2072 2069 }