~rockorager/comlink

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] ui: use channel and sender in notification title

Details
Message ID
<20240719134026.33211-1-greg@gpanders.com>
DKIM signature
pass
Download raw message
Patch: +11 -1
---
 src/App.zig | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/App.zig b/src/App.zig
index 20912f4..5d0e864 100644
--- a/src/App.zig
+++ b/src/App.zig
@@ -784,7 +784,17 @@ pub fn run(self: *App) !void {
                                const content = iter.next() orelse continue;
                                var has_highlight = false;
                                if (std.mem.indexOf(u8, content, msg.client.config.nick)) |_| {
                                    try self.vx.notify(writer, "comlink", content);
                                    var buf: [64]u8 = undefined;
                                    const title_or_err = if (msg.source) |source|
                                        std.fmt.bufPrint(&buf, "{s} - {s}", .{channel.name, source })
                                    else
                                        std.fmt.bufPrint(&buf, "{s}", .{channel.name});
                                    const title = title_or_err catch title: {
                                        const len = @min(buf.len, channel.name.len);
                                        @memcpy(buf[0..len], channel.name[0..len]);
                                        break :title buf[0..len];
                                    };
                                    try self.vx.notify(writer, title, content);
                                    has_highlight = true;
                                }
                                const time = msg.time orelse continue;
-- 
2.45.2
Details
Message ID
<D2TMTD83WWQU.37O243CGCVFY8@timculverhouse.com>
In-Reply-To
<20240719134026.33211-1-greg@gpanders.com> (view parent)
DKIM signature
pass
Download raw message
On Fri Jul 19, 2024 at 8:40 AM CDT, Gregory Anders wrote:
> ---
>  src/App.zig | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/App.zig b/src/App.zig
> index 20912f4..5d0e864 100644
> --- a/src/App.zig
> +++ b/src/App.zig
> @@ -784,7 +784,17 @@ pub fn run(self: *App) !void {
>                                  const content = iter.next() orelse continue;
>                                  var has_highlight = false;
>                                  if (std.mem.indexOf(u8, content, msg.client.config.nick)) |_| {
> -                                    try self.vx.notify(writer, "comlink", content);
> +                                    var buf: [64]u8 = undefined;
> +                                    const title_or_err = if (msg.source) |source|
> +                                        std.fmt.bufPrint(&buf, "{s} - {s}", .{channel.name, source })
> +                                    else
> +                                        std.fmt.bufPrint(&buf, "{s}", .{channel.name});
> +                                    const title = title_or_err catch title: {
> +                                        const len = @min(buf.len, channel.name.len);
> +                                        @memcpy(buf[0..len], channel.name[0..len]);
> +                                        break :title buf[0..len];
> +                                    };
> +                                    try self.vx.notify(writer, title, content);
>                                      has_highlight = true;
>                                  }
>                                  const time = msg.time orelse continue;

Applied, thanks!

-- 
Tim
Reply to thread Export thread (mbox)