Fix misc compiler warnings

This commit is contained in:
fiaxh 2021-10-12 16:26:50 +02:00
parent bea85c8ab5
commit e8c162eae3
4 changed files with 14 additions and 9 deletions

View file

@ -124,11 +124,15 @@ namespace Dino {
XmppStream? stream = stream_interactor.get_stream(account); XmppStream? stream = stream_interactor.get_stream(account);
if (stream == null) return; if (stream == null) return;
Xep.Jingle.Session session = yield stream.get_module(Xep.JingleRtp.Module.IDENTITY).start_call(stream, full_jid, video, sid); try {
sessions[call] = session; Xep.Jingle.Session session = yield stream.get_module(Xep.JingleRtp.Module.IDENTITY).start_call(stream, full_jid, video, sid);
sid_by_call[call.account][call] = session.sid; sessions[call] = session;
sid_by_call[call.account][call] = session.sid;
connect_session_signals(call, session); connect_session_signals(call, session);
} catch (Error e) {
warning("Failed to start call: %s", e.message);
}
} }
public void end_call(Conversation conversation, Call call) { public void end_call(Conversation conversation, Call call) {

View file

@ -20,7 +20,7 @@ public class Dino.Plugins.Rtp.Module : JingleRtp.Module {
string pipeline_desc = @"$(media)testsrc is-live=true ! $element_desc ! appsink name=output"; string pipeline_desc = @"$(media)testsrc is-live=true ! $element_desc ! appsink name=output";
try { try {
var pipeline = Gst.parse_launch(pipeline_desc); var pipeline = Gst.parse_launch(pipeline_desc);
var output = (pipeline as Gst.Bin).get_by_name("output") as Gst.App.Sink; var output = ((Gst.Bin) pipeline).get_by_name("output") as Gst.App.Sink;
SourceFunc callback = pipeline_works.callback; SourceFunc callback = pipeline_works.callback;
var finished = false; var finished = false;
output.emit_signals = true; output.emit_signals = true;

View file

@ -1,5 +1,7 @@
public class Xmpp.DirectTlsXmppStream : TlsXmppStream { public class Xmpp.DirectTlsXmppStream : TlsXmppStream {
const string[] ADVERTISED_PROTOCOLS = {"xmpp-client"};
string host; string host;
uint16 port; uint16 port;
TlsXmppStream.OnInvalidCertWrapper on_invalid_cert; TlsXmppStream.OnInvalidCertWrapper on_invalid_cert;
@ -18,7 +20,7 @@ public class Xmpp.DirectTlsXmppStream : TlsXmppStream {
IOStream? io_stream = yield client.connect_to_host_async(host, port); IOStream? io_stream = yield client.connect_to_host_async(host, port);
TlsConnection tls_connection = TlsClientConnection.new(io_stream, new NetworkAddress(remote_name.to_string(), port)); TlsConnection tls_connection = TlsClientConnection.new(io_stream, new NetworkAddress(remote_name.to_string(), port));
#if ALPN_SUPPORT #if ALPN_SUPPORT
tls_connection.set_advertised_protocols(new string[]{"xmpp-client"}); tls_connection.set_advertised_protocols(ADVERTISED_PROTOCOLS);
#endif #endif
tls_connection.accept_certificate.connect(on_invalid_certificate); tls_connection.accept_certificate.connect(on_invalid_certificate);
tls_connection.accept_certificate.connect((cert, flags) => on_invalid_cert.func(cert, flags)); tls_connection.accept_certificate.connect((cert, flags) => on_invalid_cert.func(cert, flags));

View file

@ -9,7 +9,6 @@ private const string NS_URI_USER = NS_URI + "#user";
private const string NS_URI_REQUEST = NS_URI + "#request"; private const string NS_URI_REQUEST = NS_URI + "#request";
public enum MucEnterError { public enum MucEnterError {
NONE,
PASSWORD_REQUIRED, PASSWORD_REQUIRED,
BANNED, BANNED,
ROOM_DOESNT_EXIST, ROOM_DOESNT_EXIST,
@ -286,7 +285,7 @@ public class Module : XmppStreamModule {
Jid bare_jid = presence.from.bare_jid; Jid bare_jid = presence.from.bare_jid;
ErrorStanza? error_stanza = presence.get_error(); ErrorStanza? error_stanza = presence.get_error();
if (flag.get_enter_id(bare_jid) == presence.id) { if (flag.get_enter_id(bare_jid) == presence.id) {
MucEnterError error = MucEnterError.NONE; MucEnterError? error = null;
switch (error_stanza.condition) { switch (error_stanza.condition) {
case ErrorStanza.CONDITION_NOT_AUTHORIZED: case ErrorStanza.CONDITION_NOT_AUTHORIZED:
if (ErrorStanza.TYPE_AUTH == error_stanza.type_) error = MucEnterError.PASSWORD_REQUIRED; if (ErrorStanza.TYPE_AUTH == error_stanza.type_) error = MucEnterError.PASSWORD_REQUIRED;
@ -313,7 +312,7 @@ public class Module : XmppStreamModule {
if (ErrorStanza.TYPE_CANCEL == error_stanza.type_) error = MucEnterError.USE_RESERVED_ROOMNICK; if (ErrorStanza.TYPE_CANCEL == error_stanza.type_) error = MucEnterError.USE_RESERVED_ROOMNICK;
break; break;
} }
if (error != MucEnterError.NONE) { if (error != null) {
flag.enter_futures[bare_jid].set_value(new JoinResult() {muc_error=error}); flag.enter_futures[bare_jid].set_value(new JoinResult() {muc_error=error});
} else { } else {
flag.enter_futures[bare_jid].set_value(new JoinResult() {stanza_error=error_stanza.condition}); flag.enter_futures[bare_jid].set_value(new JoinResult() {stanza_error=error_stanza.condition});