Fix runtime criticals (and compiler warnings)

fixes #520
This commit is contained in:
fiaxh 2019-02-13 16:13:37 +01:00
parent 6613f3f05a
commit d668e0158d
6 changed files with 6 additions and 6 deletions

View file

@ -105,10 +105,12 @@ public class Conversation : Object {
Xmpp.XmppStream? stream = stream_interactor.get_stream(account); Xmpp.XmppStream? stream = stream_interactor.get_stream(account);
if (!Application.get_default().settings.notifications) return NotifySetting.OFF; if (!Application.get_default().settings.notifications) return NotifySetting.OFF;
if (type_ == Type.GROUPCHAT) { if (type_ == Type.GROUPCHAT) {
Xmpp.Xep.Muc.Flag flag = stream.get_flag(Xmpp.Xep.Muc.Flag.IDENTITY); Xmpp.Xep.Muc.Flag? flag = stream.get_flag(Xmpp.Xep.Muc.Flag.IDENTITY);
if (flag != null) { if (flag != null) {
bool members_only = flag.has_room_feature(counterpart.bare_jid, Xmpp.Xep.Muc.Feature.MEMBERS_ONLY); bool members_only = flag.has_room_feature(counterpart.bare_jid, Xmpp.Xep.Muc.Feature.MEMBERS_ONLY);
return members_only ? NotifySetting.ON : NotifySetting.HIGHLIGHT; return members_only ? NotifySetting.ON : NotifySetting.HIGHLIGHT;
} else {
return NotifySetting.OFF;
} }
} }
return NotifySetting.ON; return NotifySetting.ON;

View file

@ -232,7 +232,7 @@ public class ConnectionManager : Object {
private void check_reconnect(Account account) { private void check_reconnect(Account account) {
bool acked = false; bool acked = false;
DateTime? last_activity_was = connections[account].last_activity != null ? connections[account].last_activity : null; DateTime? last_activity_was = connections[account].last_activity;
XmppStream stream = connections[account].stream; XmppStream stream = connections[account].stream;
stream.get_module(Xep.Ping.Module.IDENTITY).send_ping(stream, account.bare_jid.domain_jid, () => { stream.get_module(Xep.Ping.Module.IDENTITY).send_ping(stream, account.bare_jid.domain_jid, () => {

View file

@ -22,7 +22,6 @@ public class ConversationTitlebar : Gtk.Box {
} }
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private Conversation? conversation;
private Box content_box = new Box(Orientation.HORIZONTAL, 0) { margin=5, margin_start=15, margin_end=5, hexpand=true, visible=true }; private Box content_box = new Box(Orientation.HORIZONTAL, 0) { margin=5, margin_start=15, margin_end=5, hexpand=true, visible=true };
private Label title_label = new Label("") { visible=true }; private Label title_label = new Label("") { visible=true };

View file

@ -9,7 +9,6 @@ public class ConversationTitlebarCsd : Gtk.HeaderBar {
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private Window window; private Window window;
private Conversation? conversation;
public ConversationTitlebarCsd(StreamInteractor stream_interactor, Window window) { public ConversationTitlebarCsd(StreamInteractor stream_interactor, Window window) {
this.stream_interactor = stream_interactor; this.stream_interactor = stream_interactor;

View file

@ -215,7 +215,7 @@ public class AddAccountDialog : Gtk.Dialog {
private async void on_sign_in_jid_continue_button_clicked() { private async void on_sign_in_jid_continue_button_clicked() {
Jid jid = new Jid(jid_entry.get_text()); Jid jid = new Jid(jid_entry.get_text());
sign_in_jid_continue_stack.visible_child_name = "spinner"; sign_in_jid_continue_stack.visible_child_name = "spinner";
Register.ServerAvailabilityReturn server_status = yield stream_interactor.get_module(Register.IDENTITY).check_server_availability(jid); Register.ServerAvailabilityReturn server_status = yield Register.check_server_availability(jid);
sign_in_jid_continue_stack.visible_child_name = "label"; sign_in_jid_continue_stack.visible_child_name = "label";
if (server_status.available) { if (server_status.available) {
show_sign_in_password(); show_sign_in_password();

View file

@ -195,7 +195,7 @@ public class Dialog : Gtk.Dialog {
active_switch.set_active(account.enabled); active_switch.set_active(account.enabled);
jid_label.label = account.bare_jid.to_string(); jid_label.label = account.bare_jid.to_string();
alias_hybrid.text = account.alias; alias_hybrid.text = account.alias ?? "";
password_hybrid.entry.input_purpose = InputPurpose.PASSWORD; password_hybrid.entry.input_purpose = InputPurpose.PASSWORD;
password_hybrid.text = account.password; password_hybrid.text = account.password;