~rockorager/comlink

ui: use channel and sender in notification title v1 PROPOSED

Gregory Anders: 1
 ui: use channel and sender in notification title

 1 files changed, 11 insertions(+), 1 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/53979/mbox | git am -3
Learn more about email & git

[PATCH] ui: use channel and sender in notification title Export this patch

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