diff options
author | hrxi <hrrrxi@gmail.com> | 2019-12-28 03:11:51 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-03-19 22:06:02 +0100 |
commit | 148cf48d2b68354881066e2587e2673c91d2619a (patch) | |
tree | 623c2eda8dda8d327084b36bc74120933be061bf /libdino/src | |
parent | e70b7c1222506a881b4166c67803c467e1985bbc (diff) | |
download | dino-148cf48d2b68354881066e2587e2673c91d2619a.tar.gz dino-148cf48d2b68354881066e2587e2673c91d2619a.zip |
Add libnice and listen for direct connections in Jingle SOCKS5 (#608)
Add libnice as a plugin. If it is present, use libnice to enumerate
local IP addresses and listen on them to support direct connections for
Jingle SOCKS5.
Tested with Conversations and Gajim.
Created the nice.vapi file using
```
vapigen --library nice --pkg gio-2.0 --metadatadir metadata /usr/share/gir-1.0/Nice-0.1.gir
```
Diffstat (limited to 'libdino/src')
-rw-r--r-- | libdino/src/service/connection_manager.vala | 2 | ||||
-rw-r--r-- | libdino/src/service/stream_interactor.vala | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/libdino/src/service/connection_manager.vala b/libdino/src/service/connection_manager.vala index e0f4e19c..454bcc2c 100644 --- a/libdino/src/service/connection_manager.vala +++ b/libdino/src/service/connection_manager.vala @@ -8,6 +8,7 @@ namespace Dino { public class ConnectionManager : Object { public signal void stream_opened(Account account, XmppStream stream); + public signal void stream_attached_modules(Account account, XmppStream stream); public signal void connection_state_changed(Account account, ConnectionState state); public signal void connection_error(Account account, ConnectionError error); @@ -225,6 +226,7 @@ public class ConnectionManager : Object { connections[account].established = new DateTime.now_utc(); stream.attached_modules.connect((stream) => { + stream_attached_modules(account, stream); change_connection_state(account, ConnectionState.CONNECTED); }); stream.get_module(Sasl.Module.IDENTITY).received_auth_failure.connect((stream, node) => { diff --git a/libdino/src/service/stream_interactor.vala b/libdino/src/service/stream_interactor.vala index e60a43d6..192460d4 100644 --- a/libdino/src/service/stream_interactor.vala +++ b/libdino/src/service/stream_interactor.vala @@ -11,7 +11,7 @@ public class StreamInteractor : Object { public signal void account_removed(Account account); public signal void stream_resumed(Account account, XmppStream stream); public signal void stream_negotiated(Account account, XmppStream stream); - public signal void attached_modules(Account account, XmppStream stream); + public signal void stream_attached_modules(Account account, XmppStream stream); public ModuleManager module_manager; public ConnectionManager connection_manager; @@ -22,6 +22,9 @@ public class StreamInteractor : Object { connection_manager = new ConnectionManager(module_manager); connection_manager.stream_opened.connect(on_stream_opened); + connection_manager.stream_attached_modules.connect((account, stream) => { + stream_attached_modules(account, stream); + }); } public void connect_account(Account account) { |