Fix slash commands
This commit is contained in:
parent
8e6db8859c
commit
f34aa58626
|
@ -155,7 +155,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void show_join_muc_dialog(Account? account, Jid jid) {
|
private void show_join_muc_dialog(Account? account, Jid jid) {
|
||||||
Dialog dialog = new Dialog.with_buttons(_("Join Conference"), window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.USE_HEADER_BAR, _("Join"), ResponseType.OK, _("Cancel"), ResponseType.CANCEL);
|
Dialog dialog = new Dialog.with_buttons(_("Join Channel"), window, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.USE_HEADER_BAR, _("Join"), ResponseType.OK, _("Cancel"), ResponseType.CANCEL);
|
||||||
dialog.modal = true;
|
dialog.modal = true;
|
||||||
Button ok_button = dialog.get_widget_for_response(ResponseType.OK) as Button;
|
Button ok_button = dialog.get_widget_for_response(ResponseType.OK) as Button;
|
||||||
ok_button.get_style_context().add_class("suggested-action");
|
ok_button.get_style_context().add_class("suggested-action");
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Dino.Ui.ChatInput {
|
||||||
[GtkTemplate (ui = "/im/dino/Dino/chat_input.ui")]
|
[GtkTemplate (ui = "/im/dino/Dino/chat_input.ui")]
|
||||||
public class View : Box {
|
public class View : Box {
|
||||||
|
|
||||||
public signal void send_text(string text);
|
public signal void send_text();
|
||||||
|
|
||||||
public string text {
|
public string text {
|
||||||
owned get { return text_input.buffer.text; }
|
owned get { return text_input.buffer.text; }
|
||||||
|
@ -138,7 +138,7 @@ public class View : Box {
|
||||||
if ((event.state & ModifierType.SHIFT_MASK) > 0) {
|
if ((event.state & ModifierType.SHIFT_MASK) > 0) {
|
||||||
text_input.buffer.insert_at_cursor("\n", 1);
|
text_input.buffer.insert_at_cursor("\n", 1);
|
||||||
} else if (this.text != "") {
|
} else if (this.text != "") {
|
||||||
send_text(this.text);
|
send_text();
|
||||||
edit_history.reset_history();
|
edit_history.reset_history();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -82,8 +82,8 @@ public class ChatInputController : Object {
|
||||||
|
|
||||||
string text = chat_input.text_input.buffer.text;
|
string text = chat_input.text_input.buffer.text;
|
||||||
chat_input.text_input.buffer.text = "";
|
chat_input.text_input.buffer.text = "";
|
||||||
if (chat_input.text.has_prefix("/")) {
|
if (text.has_prefix("/")) {
|
||||||
string[] token = chat_input.text.split(" ", 2);
|
string[] token = text.split(" ", 2);
|
||||||
switch(token[0]) {
|
switch(token[0]) {
|
||||||
case "/me":
|
case "/me":
|
||||||
// Just send as is.
|
// Just send as is.
|
||||||
|
|
Loading…
Reference in a new issue