mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Show message on /msg when windows full
This commit is contained in:
parent
213ccc0150
commit
671e7d589f
@ -1264,6 +1264,8 @@ _cmd_msg(gchar **args, struct cmd_help_t help)
|
||||
|
||||
if (conn_status != JABBER_CONNECTED) {
|
||||
cons_show("You are not currently connected.");
|
||||
} else if (ui_windows_full()) {
|
||||
cons_bad_show("Windows all used, close a window and try again.");
|
||||
} else {
|
||||
jabber_send(msg, usr);
|
||||
win_show_outgoing_msg("me", usr, msg);
|
||||
|
1
src/ui.h
1
src/ui.h
@ -75,6 +75,7 @@ void ui_contact_offline(const char * const from, const char * const show,
|
||||
void ui_disconnected(void);
|
||||
void ui_handle_special_keys(const int * const ch);
|
||||
void ui_switch_win(const int i);
|
||||
gboolean ui_windows_full(void);
|
||||
|
||||
// create windows
|
||||
void create_title_bar(void);
|
||||
|
@ -166,6 +166,19 @@ ui_load_colours(void)
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
ui_windows_full(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < NUM_WINS; i++) {
|
||||
if (windows[i] == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
ui_show_typing(const char * const from)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user