tangled
alpha
login
or
join now
rockorager.dev
/
comlink
2
fork
atom
an experimental irc client
2
fork
atom
overview
issues
pulls
pipelines
irc: only update msg_offset if in batch
rockorager.dev
1 year ago
265054d5
458eb42d
verified
This commit was signed with the committer's
known signature
.
rockorager.dev
SSH Key Fingerprint:
SHA256:qn/Fjy7CpbcogGEPB14Y53hLnQleZNFY9lkQnuudFLs=
+5
-3
1 changed file
expand all
collapse all
unified
split
src
irc.zig
+5
-3
src/irc.zig
···
307
307
308
308
pub fn insertMessage(self: *Channel, msg: Message) !void {
309
309
try self.messages.append(msg);
310
310
-
if (self.scroll.msg_offset) |offset| {
311
311
-
self.scroll.msg_offset = offset + 1;
312
312
-
}
313
310
if (msg.timestamp_s > self.last_read) {
314
311
self.has_unread = true;
315
312
if (msg.containsPhrase(self.client.nickname())) {
···
2218
2215
var channel = entry.value_ptr.*;
2219
2216
try channel.insertMessage(msg2);
2220
2217
std.sort.insertion(Message, channel.messages.items, {}, Message.compareTime);
2218
2218
+
// We are probably adding at the top. Add to our msg_offset if we have one to
2219
2219
+
// prevent scroll
2220
2220
+
if (channel.scroll.msg_offset) |offset| {
2221
2221
+
channel.scroll.msg_offset = offset + 1;
2222
2222
+
}
2221
2223
channel.at_oldest = false;
2222
2224
return;
2223
2225
}