Fix slash commands

This commit is contained in:
fiaxh 2019-10-16 03:25:44 +02:00
parent 8e6db8859c
commit f34aa58626
3 changed files with 5 additions and 5 deletions

View file

@ -155,7 +155,7 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
}
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;
Button ok_button = dialog.get_widget_for_response(ResponseType.OK) as Button;
ok_button.get_style_context().add_class("suggested-action");

View file

@ -10,7 +10,7 @@ namespace Dino.Ui.ChatInput {
[GtkTemplate (ui = "/im/dino/Dino/chat_input.ui")]
public class View : Box {
public signal void send_text(string text);
public signal void send_text();
public string text {
owned get { return text_input.buffer.text; }
@ -138,7 +138,7 @@ public class View : Box {
if ((event.state & ModifierType.SHIFT_MASK) > 0) {
text_input.buffer.insert_at_cursor("\n", 1);
} else if (this.text != "") {
send_text(this.text);
send_text();
edit_history.reset_history();
}
return true;

View file

@ -82,8 +82,8 @@ public class ChatInputController : Object {
string text = chat_input.text_input.buffer.text;
chat_input.text_input.buffer.text = "";
if (chat_input.text.has_prefix("/")) {
string[] token = chat_input.text.split(" ", 2);
if (text.has_prefix("/")) {
string[] token = text.split(" ", 2);
switch(token[0]) {
case "/me":
// Just send as is.