diff options
| author | Marvin W <git@larma.de> | 2026-07-27 14:24:52 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-08-02 12:44:10 +0200 |
| commit | baea5162d4a855d2ae1ad630ed65861c8faac0e7 (patch) | |
| tree | 478a3f296080322ee5d77d73f771e2873a04cdf7 /xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala | |
| parent | 84a47eee3b5cf4a73ad7d14a292f8b23b944a592 (diff) | |
bind2: Add user agent id and details
Diffstat (limited to 'xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala')
| -rw-r--r-- | xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala b/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala index f7db524d..1c6afb30 100644 --- a/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala +++ b/xmpp-vala/src/module/xep/0388_extensible_sasl_profile.vala @@ -11,12 +11,16 @@ namespace Xmpp.Xep.ExtensibleSaslProfile { public string name { get; set; } public string password { get; set; } + public string user_agent_id { get; set; } + public string? user_agent_software { get; set; default = "Dino"; } + public string? user_agent_device { get; set; } public signal void received_auth_failure(XmppStream stream, StanzaNode node); - public Module(string name, string password) { + public Module(string name, string password, string user_agent_id) { this.name = name; this.password = password; + this.user_agent_id = user_agent_id; } public override void attach(XmppStream stream) { @@ -117,6 +121,11 @@ namespace Xmpp.Xep.ExtensibleSaslProfile { } } + StanzaNode user_agent_node = new StanzaNode.build("user-agent", NS_URI).put_attribute("id", user_agent_id); + if (user_agent_software != null) user_agent_node.put_node(new StanzaNode.build("software", NS_URI).put_node(new StanzaNode.text(user_agent_software))); + if (user_agent_device != null) user_agent_node.put_node(new StanzaNode.build("device", NS_URI).put_node(new StanzaNode.text(user_agent_device))); + authenticate_node.put_node(user_agent_node); + stream.write(authenticate_node); } |
