aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-04-17 22:46:12 +0200
committerfiaxh <git@mx.ax.lt>2017-04-17 22:48:43 +0200
commitc6ff3387fa7b23678bbfe644c9e1b668ac92a731 (patch)
treeb94ff5fb03bff01a0f204883bdcf827f528f7567 /main
parent653c361420d658097a4affeb8bf256f02cc9bb2a (diff)
downloaddino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.tar.gz
dino-c6ff3387fa7b23678bbfe644c9e1b668ac92a731.zip
Handle conference bookmarks w/o nick
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/add_conversation/conference/add_groupchat_dialog.vala7
-rw-r--r--main/src/ui/add_conversation/conference/conference_details_fragment.vala10
-rw-r--r--main/src/ui/chat_input/smiley_converter.vala4
-rw-r--r--main/src/ui/conversation_selector/list.vala2
4 files changed, 11 insertions, 12 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;
diff --git a/main/src/ui/chat_input/smiley_converter.vala b/main/src/ui/chat_input/smiley_converter.vala
index 73413972..849745f9 100644
--- a/main/src/ui/chat_input/smiley_converter.vala
+++ b/main/src/ui/chat_input/smiley_converter.vala
@@ -13,7 +13,7 @@ class SmileyConverter {
private static HashMap<string, string> smiley_translations = new HashMap<string, string>();
static construct {
- smiley_translations[":)"] = "🙂";
+ smiley_translations[":)"] = "☺";
smiley_translations[":D"] = "😀";
smiley_translations[";)"] = "😉";
smiley_translations["O:)"] = "😇";
@@ -22,7 +22,7 @@ class SmileyConverter {
smiley_translations[":o"] = "😮";
smiley_translations[":P"] = "😛";
smiley_translations[";P"] = "😜";
- smiley_translations[":("] = "🙁";
+ smiley_translations[":("] = "☹";
smiley_translations[":'("] = "😢";
smiley_translations[":/"] = "😕";
}
diff --git a/main/src/ui/conversation_selector/list.vala b/main/src/ui/conversation_selector/list.vala
index 2e56a305..3d6ee895 100644
--- a/main/src/ui/conversation_selector/list.vala
+++ b/main/src/ui/conversation_selector/list.vala
@@ -149,7 +149,7 @@ public class List : ListBox {
ListBoxRow? index_m1 = get_row_at_index(index - 1);
if (index_m1 != null) {
select_row(index_m1);
- row_activated(index_p1);
+ row_activated(index_m1);
}
}
}