1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Removed ui_xmlconsole_exists

This commit is contained in:
James Booth 2015-11-01 19:26:31 +00:00
parent be90e44d4a
commit 486d2e0495
4 changed files with 27 additions and 41 deletions

View File

@ -4397,10 +4397,11 @@ cmd_vercheck(ProfWin *window, const char *const command, gchar **args)
gboolean
cmd_xmlconsole(ProfWin *window, const char *const command, gchar **args)
{
if (!ui_xmlconsole_exists()) {
ui_create_xmlconsole_win();
} else {
ProfXMLWin *xmlwin = wins_get_xmlconsole();
if (xmlwin) {
ui_open_xmlconsole_win();
} else {
ui_create_xmlconsole_win();
}
return TRUE;

View File

@ -222,33 +222,39 @@ ui_load_colours(void)
}
}
gboolean
ui_xmlconsole_exists(void)
void
ui_create_xmlconsole_win(void)
{
ProfWin *window = wins_new_xmlconsole();
ui_switch_win(window);
}
void
ui_open_xmlconsole_win(void)
{
ProfXMLWin *xmlwin = wins_get_xmlconsole();
if (xmlwin) {
return TRUE;
} else {
return FALSE;
ui_switch_win((ProfWin*)xmlwin);
}
}
void
ui_handle_stanza(const char *const msg)
{
if (ui_xmlconsole_exists()) {
ProfXMLWin *xmlconsole = wins_get_xmlconsole();
ProfWin *window = (ProfWin*) xmlconsole;
ProfXMLWin *xmlwin = wins_get_xmlconsole();
if (!xmlwin) {
return;
}
if (g_str_has_prefix(msg, "SENT:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "SENT:");
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", "");
} else if (g_str_has_prefix(msg, "RECV:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "RECV:");
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", "");
}
ProfWin *window = (ProfWin*)xmlwin;
if (g_str_has_prefix(msg, "SENT:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "SENT:");
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_ONLINE, "", "");
} else if (g_str_has_prefix(msg, "RECV:")) {
win_print(window, '-', 0, NULL, 0, 0, "", "RECV:");
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", &msg[6]);
win_print(window, '-', 0, NULL, 0, THEME_AWAY, "", "");
}
}
@ -897,22 +903,6 @@ ui_new_private_win(const char *const fulljid)
return (ProfPrivateWin*)window;
}
void
ui_create_xmlconsole_win(void)
{
ProfWin *window = wins_new_xmlconsole();
ui_switch_win(window);
}
void
ui_open_xmlconsole_win(void)
{
ProfXMLWin *xmlwin = wins_get_xmlconsole();
if (xmlwin) {
ui_switch_win((ProfWin*)xmlwin);
}
}
void
ui_outgoing_private_msg(ProfPrivateWin *privwin, const char *const message)
{

View File

@ -189,7 +189,6 @@ void ui_statusbar_new(const int win);
void ui_write(char *line, int offset);
void ui_invalid_command_usage(const char *const cmd, void (*setting_func)(void));
void ui_create_xmlconsole_win(void);
gboolean ui_xmlconsole_exists(void);
void ui_open_xmlconsole_win(void);
gboolean ui_win_has_unsaved_form(int num);
void ui_inp_history_append(char *inp);

View File

@ -321,10 +321,6 @@ void ui_inp_history_append(char *inp) {}
void ui_invalid_command_usage(const char * const usage, void (*setting_func)(void)) {}
void ui_create_xmlconsole_win(void) {}
gboolean ui_xmlconsole_exists(void)
{
return FALSE;
}
void ui_open_xmlconsole_win(void) {}