Use win_printf_line where appropriate
This commit is contained in:
@@ -413,19 +413,19 @@ ui_handle_recipient_error(const char *const recipient, const char *const err_msg
|
||||
|
||||
ProfChatWin *chatwin = wins_get_chat(recipient);
|
||||
if (chatwin) {
|
||||
win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
|
||||
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
ProfMucWin *mucwin = wins_get_muc(recipient);
|
||||
if (mucwin) {
|
||||
win_printf((ProfWin*)mucwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
|
||||
win_printf_line((ProfWin*)mucwin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
ProfPrivateWin *privatewin = wins_get_private(recipient);
|
||||
if (privatewin) {
|
||||
win_printf((ProfWin*)privatewin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
|
||||
win_printf_line((ProfWin*)privatewin, THEME_ERROR, '!', "Error from %s: %s", recipient, err_msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -435,7 +435,7 @@ ui_handle_otr_error(const char *const barejid, const char *const message)
|
||||
{
|
||||
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||
if (chatwin) {
|
||||
win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", "%s", message);
|
||||
win_printf_line((ProfWin*)chatwin, THEME_ERROR, '!', "%s", message);
|
||||
} else {
|
||||
cons_show_error("%s - %s", barejid, message);
|
||||
}
|
||||
@@ -752,7 +752,7 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char *con
|
||||
va_start(arg, msg);
|
||||
GString *fmt_msg = g_string_new(NULL);
|
||||
g_string_vprintf(fmt_msg, msg, arg);
|
||||
win_printf(current, show_char, 0, NULL, 0, attrs, "", "%s", fmt_msg->str);
|
||||
win_printf_line(current, attrs, show_char, "%s", fmt_msg->str);
|
||||
va_end(arg);
|
||||
g_string_free(fmt_msg, TRUE);
|
||||
}
|
||||
@@ -823,7 +823,7 @@ ui_room_join(const char *const roomjid, gboolean focus)
|
||||
status_bar_active(num);
|
||||
ProfWin *console = wins_get_console();
|
||||
char *nick = muc_nick(roomjid);
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "-> Autojoined %s as %s (%d).", roomjid, nick, num);
|
||||
win_printf_line(console, THEME_TYPING, '!', "-> Autojoined %s as %s (%d).", roomjid, nick, num);
|
||||
}
|
||||
|
||||
GList *privwins = wins_get_private_chats(roomjid);
|
||||
@@ -898,16 +898,16 @@ ui_room_destroyed(const char *const roomjid, const char *const reason, const cha
|
||||
ProfWin *console = wins_get_console();
|
||||
|
||||
if (reason) {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s, reason: %s", roomjid, reason);
|
||||
win_printf_line(console, THEME_TYPING, '!', "<- Room destroyed: %s, reason: %s", roomjid, reason);
|
||||
} else {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s", roomjid);
|
||||
win_printf_line(console, THEME_TYPING, '!', "<- Room destroyed: %s", roomjid);
|
||||
}
|
||||
|
||||
if (new_jid) {
|
||||
if (password) {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "Replacement room: %s, password: %s", new_jid, password);
|
||||
win_printf_line(console, THEME_TYPING, '!', "Replacement room: %s, password: %s", new_jid, password);
|
||||
} else {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "Replacement room: %s", new_jid);
|
||||
win_printf_line(console, THEME_TYPING, '!', "Replacement room: %s", new_jid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -944,7 +944,7 @@ ui_room_kicked(const char *const roomjid, const char *const actor, const char *c
|
||||
}
|
||||
|
||||
ProfWin *console = wins_get_console();
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- %s", message->str);
|
||||
win_printf_line(console, THEME_TYPING, '!', "<- %s", message->str);
|
||||
g_string_free(message, TRUE);
|
||||
}
|
||||
|
||||
@@ -980,7 +980,7 @@ ui_room_banned(const char *const roomjid, const char *const actor, const char *c
|
||||
}
|
||||
|
||||
ProfWin *console = wins_get_console();
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- %s", message->str);
|
||||
win_printf_line(console, THEME_TYPING, '!', "<- %s", message->str);
|
||||
g_string_free(message, TRUE);
|
||||
}
|
||||
|
||||
@@ -1028,13 +1028,13 @@ ui_ask_pgp_passphrase(const char *hint, int prev_fail)
|
||||
win_println(current, 0, "");
|
||||
|
||||
if (prev_fail) {
|
||||
win_printf(current, '!', 0, NULL, 0, THEME_DEFAULT, "", "Incorrect passphrase");
|
||||
win_printf_line(current, THEME_DEFAULT, '!', "Incorrect passphrase");
|
||||
}
|
||||
|
||||
if (hint) {
|
||||
win_printf(current, '!', 0, NULL, 0, THEME_DEFAULT, "", "Enter PGP key passphrase for %s", hint);
|
||||
win_printf_line(current, THEME_DEFAULT, '!', "Enter PGP key passphrase for %s", hint);
|
||||
} else {
|
||||
win_printf(current, '!', 0, NULL, 0, THEME_DEFAULT, "", "Enter PGP key passphrase");
|
||||
win_printf_line(current, THEME_DEFAULT, '!', "Enter PGP key passphrase");
|
||||
}
|
||||
|
||||
ui_update();
|
||||
@@ -1182,7 +1182,7 @@ ui_handle_room_config_submit_result(const char *const roomjid)
|
||||
|
||||
if (muc_window) {
|
||||
ui_focus_win((ProfWin*)muc_window);
|
||||
win_printf(muc_window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room configuration successful");
|
||||
win_printf_line(muc_window, THEME_ROOMINFO, '!', "Room configuration successful");
|
||||
} else {
|
||||
ProfWin *console = wins_get_console();
|
||||
ui_focus_win(console);
|
||||
@@ -1209,25 +1209,25 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char
|
||||
|
||||
if (form_window) {
|
||||
if (message) {
|
||||
win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
|
||||
win_printf_line(form_window, THEME_ERROR, '!', "Configuration error: %s", message);
|
||||
} else {
|
||||
win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
|
||||
win_printf_line(form_window, THEME_ERROR, '!', "Configuration error");
|
||||
}
|
||||
} else if (muc_window) {
|
||||
if (message) {
|
||||
win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
|
||||
win_printf_line(muc_window, THEME_ERROR, '!', "Configuration error: %s", message);
|
||||
} else {
|
||||
win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
|
||||
win_printf_line(muc_window, THEME_ERROR, '!', "Configuration error");
|
||||
}
|
||||
} else {
|
||||
if (message) {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s: %s", roomjid, message);
|
||||
win_printf_line(console, THEME_ERROR, '!', "Configuration error for %s: %s", roomjid, message);
|
||||
} else {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s", roomjid);
|
||||
win_printf_line(console, THEME_ERROR, '!', "Configuration error for %s", roomjid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
|
||||
win_printf_line(console, THEME_ERROR, '!', "Configuration error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user