This thread contains a patchset. You're looking at the original emails,
but you may wish to use the patch review UI.
Review patch
1
[PATCH] irc: add /names command
---
Simple implementation. I implemented this while working on parsing
prefixes for members and figured I would go ahead and submit it.
src/App.zig | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/App.zig b/src/App.zig
index f4fec36..c33c977 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -1242,6 +1242,7 @@ pub const Command = enum {
@"prev-channel",
quit,
who,
+ names,
/// if we should append a space when completing
pub fn appendSpace(self: Command) bool {
@@ -1334,6 +1335,11 @@ pub fn handleCommand(self: *App, buffer: Buffer, cmd: []const u8) !void {
);
return self.queueWrite(client, msg);
},
+ .names => {
+ if (channel == null) return error.InvalidCommand;
+ const msg = try std.fmt.bufPrint(&buf, "NAMES {s}\r\n", .{channel.?.name});
+ return self.queueWrite(client, msg);
+ },
.@"next-channel" => self.nextChannel(),
.@"prev-channel" => self.prevChannel(),
.quit => self.should_quit = true,
--
2.45.2
On Wed Jun 26, 2024 at 3:58 PM CDT, Gregory Anders wrote:
> ---
> Simple implementation. I implemented this while working on parsing
> prefixes for members and figured I would go ahead and submit it.
>
> src/App.zig | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/App.zig b/src/App.zig
> index f4fec36..c33c977 100644
> --- a/src/App.zig
> +++ b/src/App.zig
> @@ -1242,6 +1242,7 @@ pub const Command = enum {
> @"prev-channel",
> quit,
> who,
> + names,
>
> /// if we should append a space when completing
> pub fn appendSpace(self: Command) bool {
> @@ -1334,6 +1335,11 @@ pub fn handleCommand(self: *App, buffer: Buffer, cmd: []const u8) !void {
> );
> return self.queueWrite(client, msg);
> },
> + .names => {
> + if (channel == null) return error.InvalidCommand;
> + const msg = try std.fmt.bufPrint(&buf, "NAMES {s}\r\n", .{channel.?.name});
> + return self.queueWrite(client, msg);
> + },
> .@"next-channel" => self.nextChannel(),
> .@"prev-channel" => self.prevChannel(),
> .quit => self.should_quit = true,
Applied! Thanks!
--
Tim