this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

irc: explicitly track when we have sent WHO/NAMES/WHOX

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>

+6 -3
+5 -3
src/App.zig
··· 638 638 const me_ptr = try msg.client.getOrCreateUser(msg.client.config.nick); 639 639 try channel.addMember(user_ptr); 640 640 try channel.addMember(me_ptr); 641 + // we set who_requested so we don't try to request 642 + // who on DMs 643 + channel.who_requested = true; 641 644 var buf: [128]u8 = undefined; 642 645 const mark_read = try std.fmt.bufPrint( 643 646 &buf, ··· 1318 1321 } 1319 1322 1320 1323 pub fn whox(self: *App, client: *Client, channel: *irc.Channel) !void { 1324 + channel.who_requested = true; 1321 1325 // Only use WHO if we have WHOX and away-notify. Without 1322 1326 // WHOX, we can get rate limited on eg. libera. Without 1323 1327 // away-notify, our list will become stale ··· 1533 1537 try self.queueWrite(client, mark_read); 1534 1538 } 1535 1539 } 1536 - // if there are no members we will request either NAMES or 1537 - // WHOX 1538 - if (channel.members.items.len == 0) try self.whox(client, channel); 1540 + if (!channel.who_requested) try self.whox(client, channel); 1539 1541 var topic_seg = [_]vaxis.Segment{ 1540 1542 .{ 1541 1543 .text = channel.topic orelse "",
+1
src/irc.zig
··· 92 92 93 93 messages: std.ArrayList(Message), 94 94 history_requested: bool = false, 95 + who_requested: bool = false, 95 96 at_oldest: bool = false, 96 97 last_read: i64 = 0, 97 98 has_unread: bool = false,