aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-04-30 22:09:39 +0100
committerJames Booth <boothj5@gmail.com>2015-04-30 22:09:39 +0100
commitd68fb25ddef2f30c9d17991aa5d1d0e2a36d8386 (patch)
treeb1179fadf9f404f096156e008cce6126d28d522f /src/command
parent20555fcb3646d789206ede9a95881fed75fbc0b9 (diff)
downloadprofani-tty-d68fb25ddef2f30c9d17991aa5d1d0e2a36d8386.tar.gz
Removed ui_win_switch_num
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index f85af612..ad8c276c 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -722,10 +722,16 @@ gboolean
cmd_win(gchar **args, struct cmd_help_t help)
{
int num = atoi(args[0]);
- gboolean switched = ui_switch_win_num(num);
- if (switched == FALSE) {
+
+ ProfWin *window = wins_get_by_num(num);
+ if (!window) {
cons_show("Window %d does not exist.", num);
+ } else {
+ if (!wins_is_current(window)) {
+ ui_ev_focus_win(window);
+ }
}
+
return TRUE;
}
@@ -2453,12 +2459,11 @@ cmd_form(gchar **args, struct cmd_help_t help)
cmd_autocomplete_remove_form_fields(confwin->form);
}
wins_close_current();
- ProfWin *current = (ProfWin*)wins_get_muc(confwin->roomjid);
- if (current == NULL) {
- current = wins_get_console();
+ ProfWin *new_current = (ProfWin*)wins_get_muc(confwin->roomjid);
+ if (!new_current) {
+ new_current = wins_get_console();
}
- int num = wins_get_num(current);
- ui_switch_win_num(num);
+ ui_ev_focus_win(new_current);
}
return TRUE;
@@ -2764,9 +2769,8 @@ cmd_room(gchar **args, struct cmd_help_t help)
if (g_strcmp0(args[0], "config") == 0) {
ProfMucConfWin *confwin = wins_get_muc_conf(mucwin->roomjid);
- if (confwin != NULL) {
- num = wins_get_num(window);
- ui_switch_win_num(num);
+ if (confwin) {
+ ui_ev_focus_win((ProfWin*)confwin);
} else {
iq_request_room_config_form(mucwin->roomjid);
}