From 6f3225979cb497db99381556adb7e42119b44ec3 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 20 Mar 2017 22:12:20 +0100 Subject: Select conversation on startup, placeholder for "No conversation selected", start services before UI --- xmpp-vala/src/core/xmpp_stream.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmpp-vala/src') diff --git a/xmpp-vala/src/core/xmpp_stream.vala b/xmpp-vala/src/core/xmpp_stream.vala index f3be115d..0283920b 100644 --- a/xmpp-vala/src/core/xmpp_stream.vala +++ b/xmpp-vala/src/core/xmpp_stream.vala @@ -237,8 +237,8 @@ public class FlagIdentity : Object { this.id = id; } - public T? cast(XmppStreamFlag module) { - return (T?) module; + public T? cast(XmppStreamFlag flag) { + return flag.get_type().is_a(typeof(T)) ? (T?) flag : null; } public bool matches(XmppStreamFlag module) { @@ -246,7 +246,7 @@ public class FlagIdentity : Object { } } -public abstract class XmppStreamFlag { +public abstract class XmppStreamFlag : Object { public abstract string get_ns(); public abstract string get_id(); } @@ -261,7 +261,7 @@ public class ModuleIdentity : Object { } public T? cast(XmppStreamModule module) { - return (T?) module; + return module.get_type().is_a(typeof(T)) ? (T?) module : null; } public bool matches(XmppStreamModule module) { -- cgit v1.2.3-70-g09d2