aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala')
-rw-r--r--xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala17
1 files changed, 15 insertions, 2 deletions
diff --git a/xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala b/xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala
index fdee2411..c184877c 100644
--- a/xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala
+++ b/xmpp-vala/src/module/xep/0065_socks5_bytestreams.vala
@@ -18,21 +18,34 @@ public class Proxy : Object {
}
}
+public delegate Gee.List<string> GetLocalIpAddresses();
+
public class Module : XmppStreamModule, Iq.Handler {
public static Xmpp.ModuleIdentity<Module> IDENTITY = new Xmpp.ModuleIdentity<Module>(NS_URI, "0065_socks5_bytestreams");
+ private GetLocalIpAddresses? get_local_ip_addresses_impl = null;
+
public override void attach(XmppStream stream) {
stream.add_flag(new Flag());
query_availability.begin(stream);
}
public override void detach(XmppStream stream) { }
- public async void on_iq_set(XmppStream stream, Iq.Stanza iq) { }
-
public Gee.List<Proxy> get_proxies(XmppStream stream) {
return stream.get_flag(Flag.IDENTITY).proxies;
}
+ public void set_local_ip_address_handler(owned GetLocalIpAddresses get_local_ip_addresses) {
+ get_local_ip_addresses_impl = (owned)get_local_ip_addresses;
+ }
+
+ public Gee.List<string> get_local_ip_addresses() {
+ if (get_local_ip_addresses_impl == null) {
+ return Gee.List.empty();
+ }
+ return get_local_ip_addresses_impl();
+ }
+
private async void query_availability(XmppStream stream) {
ServiceDiscovery.ItemsResult? items_result = yield stream.get_module(ServiceDiscovery.Module.IDENTITY).request_items(stream, stream.remote_name);
if (items_result == null) return;