this repo has no description
3
fork

Configure Feed

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

cmds: fix /part

+18 -11
+2 -2
build.zig.zon
··· 7 7 .hash = "1220affeb3fe37ef09411b5a213b5fdf9bb6568e9913bade204694648983a8b2776d", 8 8 }, 9 9 .vaxis = .{ 10 - .url = "git+https://github.com/rockorager/libvaxis#cf7c2da082a160b0f21d380fedae7f0f7fe7efbd", 11 - .hash = "122038e68a66cd160c494430559346a4d660732719dd1fa1f1f25d18de22b6974104", 10 + .url = "git+https://github.com/rockorager/libvaxis#af450ebb1ba068c5d44d7c878fa5157188094c0a", 11 + .hash = "1220212b2aa3c0148526494403917994acc01aec1f123634df5fe843e7f034c0b703", 12 12 }, 13 13 .zeit = .{ 14 14 .url = "git+https://github.com/rockorager/zeit?ref=main#d943bc4bfe9e18490460dfdd64f48e997065eba8",
+1 -2
src/app.zig
··· 509 509 if (target[0] != '#') { 510 510 for (client.channels.items, 0..) |search, i| { 511 511 if (!mem.eql(u8, search.name, target)) continue; 512 + client.app.prevChannel(); 512 513 var chan = client.channels.orderedRemove(i); 513 - self.buffer_list.cursor -|= 1; 514 - self.buffer_list.ensureScroll(); 515 514 chan.deinit(self.alloc); 516 515 self.alloc.destroy(chan); 517 516 break;
+15 -7
src/irc.zig
··· 276 276 277 277 fn onSubmit(ptr: ?*anyopaque, ctx: *vxfw.EventContext, input: []const u8) anyerror!void { 278 278 const self: *Channel = @ptrCast(@alignCast(ptr orelse unreachable)); 279 - if (std.mem.startsWith(u8, input, "/")) { 280 - try self.client.app.handleCommand(.{ .channel = self }, input); 279 + 280 + // Copy the input into a temporary buffer 281 + var buf: [1024]u8 = undefined; 282 + @memcpy(buf[0..input.len], input); 283 + const local = buf[0..input.len]; 284 + // Free the text field. We do this here because the command may destroy our channel 285 + self.text_field.clearAndFree(); 286 + self.completer_shown = false; 287 + 288 + if (std.mem.startsWith(u8, local, "/")) { 289 + try self.client.app.handleCommand(.{ .channel = self }, local); 281 290 } else { 282 - try self.client.print("PRIVMSG {s} :{s}\r\n", .{ self.name, input }); 291 + try self.client.print("PRIVMSG {s} :{s}\r\n", .{ self.name, local }); 292 + // Set the last_read to now 293 + self.last_read = std.time.timestamp(); 283 294 } 284 295 ctx.redraw = true; 285 - self.completer_shown = false; 286 - self.text_field.clearAndFree(); 287 296 } 288 297 289 298 pub fn deinit(self: *Channel, alloc: std.mem.Allocator) void { ··· 1953 1962 if (mem.eql(u8, user.nick, client.nickname())) { 1954 1963 for (client.channels.items, 0..) |channel, i| { 1955 1964 if (!mem.eql(u8, channel.name, target)) continue; 1965 + client.app.prevChannel(); 1956 1966 var chan = client.channels.orderedRemove(i); 1957 1967 chan.deinit(self.app.alloc); 1958 1968 self.alloc.destroy(chan); 1959 - self.app.buffer_list.cursor -|= 1; 1960 - self.app.buffer_list.ensureScroll(); 1961 1969 break; 1962 1970 } 1963 1971 } else {