move strings.
This commit is contained in:
parent
86e7fb6a57
commit
655363a79e
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue