diff options
author | fiaxh <git@mx.ax.lt> | 2017-04-17 22:46:12 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-04-17 22:48:43 +0200 |
commit | c6ff3387fa7b23678bbfe644c9e1b668ac92a731 (patch) | |
tree | b94ff5fb03bff01a0f204883bdcf827f528f7567 /main/src/ui/add_conversation/conference | |
parent | 653c361420d658097a4affeb8bf256f02cc9bb2a (diff) | |
download | dino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.tar.gz dino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.zip |
Handle conference bookmarks w/o nick
Diffstat (limited to 'main/src/ui/add_conversation/conference')
-rw-r--r-- | main/src/ui/add_conversation/conference/add_groupchat_dialog.vala | 7 | ||||
-rw-r--r-- | main/src/ui/add_conversation/conference/conference_details_fragment.vala | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala b/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala index 10c91c70..821360a9 100644 --- a/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala +++ b/main/src/ui/add_conversation/conference/add_groupchat_dialog.vala @@ -44,7 +44,7 @@ protected class AddGroupchatDialog : Gtk.Dialog { accounts_stack.set_visible_child_name("label"); account_label.label = account.bare_jid.to_string(); jid_entry.text = conference.jid; - nick_entry.text = conference.nick; + nick_entry.text = conference.nick ?? ""; autojoin_checkbutton.active = conference.autojoin; alias_entry.text = conference.name; } @@ -60,14 +60,13 @@ protected class AddGroupchatDialog : Gtk.Dialog { private bool check_ok() { Jid? parsed_jid = Jid.parse(jid_entry.text); - ok_button.sensitive = parsed_jid != null && parsed_jid.localpart != null && parsed_jid.resourcepart == null && - nick_entry.text != "" && alias_entry.text != null; + ok_button.sensitive = parsed_jid != null && parsed_jid.localpart != null && parsed_jid.resourcepart == null; return false; } private void on_ok_button_clicked() { Xmpp.Xep.Bookmarks.Conference conference = new Xmpp.Xep.Bookmarks.Conference(jid_entry.text); - conference.nick = nick_entry.text; + conference.nick = nick_entry.text != "" ? nick_entry.text : null; conference.name = alias_entry.text; conference.autojoin = autojoin_checkbutton.active; if (edit_confrence == null) { diff --git a/main/src/ui/add_conversation/conference/conference_details_fragment.vala b/main/src/ui/add_conversation/conference/conference_details_fragment.vala index fe57e6da..dcb69cff 100644 --- a/main/src/ui/add_conversation/conference/conference_details_fragment.vala +++ b/main/src/ui/add_conversation/conference/conference_details_fragment.vala @@ -31,14 +31,14 @@ protected class ConferenceDetailsFragment : Box { jid_entry.text = value; } } - public string nick { - get { return nick_entry.text; } + public string? nick { + get { return nick_entry.text != "" ? nick_entry.text : null; } set { - nick_label.label = value; - nick_entry.text = value; + nick_label.label = value ?? ""; + nick_entry.text = value ?? ""; } } - public string password { + public string? password { get { return password_entry.text == "" ? null : password_entry.text; } set { password_label.label = value; |