aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module
diff options
context:
space:
mode:
authorAlexandre Jousset <mid@gtmp.org>2023-11-12 13:58:01 +0100
committerfiaxh <git@lightrise.org>2024-09-22 11:39:13 +0100
commit63439cd206aaf3548228e915bd1744389cd2fc54 (patch)
tree54e8c8b5045bab2bcd353ef4eb069cd852b2bf7c /xmpp-vala/src/module
parenta7f7b1ceeb78533d1c5856ed2f2adaf0bf386340 (diff)
downloaddino-63439cd206aaf3548228e915bd1744389cd2fc54.tar.gz
dino-63439cd206aaf3548228e915bd1744389cd2fc54.zip
XEP-0215: management of the field `expires`
Add a field in `Xmpp.Xep.ExternalServiceDiscovery` to keep track of the `expires` TURN service value and use it (divided by 2) to restart periodically the external services discovery.
Diffstat (limited to 'xmpp-vala/src/module')
-rw-r--r--xmpp-vala/src/module/xep/0215_external_service_discovery.vala4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/xep/0215_external_service_discovery.vala b/xmpp-vala/src/module/xep/0215_external_service_discovery.vala
index 07c3f71c..6d41a288 100644
--- a/xmpp-vala/src/module/xep/0215_external_service_discovery.vala
+++ b/xmpp-vala/src/module/xep/0215_external_service_discovery.vala
@@ -25,6 +25,9 @@ namespace Xmpp.Xep.ExternalServiceDiscovery {
service.username = service_node.get_attribute("username", NS_URI);
service.password = service_node.get_attribute("password", NS_URI);
+ string? expires_str = service_node.get_attribute("expires", NS_URI);
+ if (expires_str != null) service.expires = DateTimeProfiles.parse_string(expires_str);
+
service.transport = service_node.get_attribute("transport", NS_URI);
service.name = service_node.get_attribute("name", NS_URI);
string? restricted_str = service_node.get_attribute("restricted", NS_URI);
@@ -41,6 +44,7 @@ namespace Xmpp.Xep.ExternalServiceDiscovery {
public string username { get; set; }
public string password { get; set; }
+ public DateTime? expires { get; set; }
public string transport { get; set; }
public string name { get; set; }