~rockorager/comlink

irc: add /names command v1 APPLIED

Gregory Anders: 1
 irc: add /names command

 1 files changed, 6 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rockorager/comlink/patches/53535/mbox | git am -3
Learn more about email & git

[PATCH] irc: add /names command Export this patch

---
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