From 655363a79eb089b051b56d3a3892b9e899c026ad Mon Sep 17 00:00:00 2001 From: Kitteh Date: Wed, 2 Jun 2021 12:05:28 +0100 Subject: [PATCH] move strings. --- src/client.zig | 6 +++--- src/main.zig | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.zig b/src/client.zig index 15fd755..0444deb 100644 --- a/src/client.zig +++ b/src/client.zig @@ -38,12 +38,12 @@ pub const Client = struct { try write.add_qvariantmap(s.stream.writer(), map); } - pub fn quassel_login(s: *Client) !void { + pub fn quassel_login(s: *Client, username: []const u8, password: []const u8) !void { var map = std.StringHashMap(qvar.QVariant).init(s.allocator); try map.put("MsgType", .{ .string = "ClientLogin" }); - try map.put("User", .{ .string = "z" }); - try map.put("Password", .{ .string = "password" }); + try map.put("User", .{ .string = username }); + try map.put("Password", .{ .string = password}); try write.add_qvariantmap(s.stream.writer(), map); } diff --git a/src/main.zig b/src/main.zig index 90509d0..ebb4d54 100644 --- a/src/main.zig +++ b/src/main.zig @@ -12,6 +12,6 @@ pub fn main() !void { var client = initClient(allocator, &sock); try client.handshake(); try client.quassel_init_packet(); - try client.quassel_login(); + try client.quassel_login("z", "password"); }