move strings.

This commit is contained in:
Kitteh 2021-06-02 12:05:28 +01:00
parent 86e7fb6a57
commit 655363a79e
2 changed files with 4 additions and 4 deletions

View file

@ -38,12 +38,12 @@ pub const Client = struct {
try write.add_qvariantmap(s.stream.writer(), map); 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); var map = std.StringHashMap(qvar.QVariant).init(s.allocator);
try map.put("MsgType", .{ .string = "ClientLogin" }); try map.put("MsgType", .{ .string = "ClientLogin" });
try map.put("User", .{ .string = "z" }); try map.put("User", .{ .string = username });
try map.put("Password", .{ .string = "password" }); try map.put("Password", .{ .string = password});
try write.add_qvariantmap(s.stream.writer(), map); try write.add_qvariantmap(s.stream.writer(), map);
} }

View file

@ -12,6 +12,6 @@ pub fn main() !void {
var client = initClient(allocator, &sock); var client = initClient(allocator, &sock);
try client.handshake(); try client.handshake();
try client.quassel_init_packet(); try client.quassel_init_packet();
try client.quassel_login(); try client.quassel_login("z", "password");
} }