Refactor win_println_incoming_muc_msg()

We never use the printf like behaviour anyways.
This commit is contained in:
Michael Vetter
2020-02-17 11:58:36 +01:00
parent 69d474b3a7
commit f13ea11f95
3 changed files with 7 additions and 15 deletions

View File

@@ -1145,29 +1145,21 @@ win_print_them(ProfWin *window, theme_item_t theme_item, char ch, int flags, con
}
void
win_println_incoming_muc_msg(ProfWin *window, char ch, int flags, const char *const them, const char *const id, const char *const replace_id, const char *const message, ...)
win_println_incoming_muc_msg(ProfWin *window, char ch, int flags, const char *const them, const char *const id, const char *const replace_id, const char *const message)
{
//TODO: we always use current timestamp here. instead of the message->timestamp one if available. i think somewhere else we check whether it exists first.
GDateTime *timestamp = g_date_time_new_now_local();
va_list arg;
va_start(arg, message);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, message, arg);
if (prefs_get_boolean(PREF_CORRECTION_ALLOW) && replace_id) {
_win_correct(window, fmt_msg->str, id, replace_id);
_win_correct(window, message, id, replace_id);
} else {
_win_printf(window, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, id, "%s", fmt_msg->str);
_win_printf(window, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, id, "%s", message);
}
// buffer_append(window->layout->buffer, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, fmt_msg->str, NULL, NULL);
// _win_print_internal(window, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, fmt_msg->str, NULL);
// buffer_append(window->layout->buffer, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, message, NULL, NULL);
// _win_print_internal(window, ch, 0, timestamp, flags | NO_ME, THEME_TEXT_THEM, them, message, NULL);
inp_nonblocking(TRUE);
g_date_time_unref(timestamp);
g_string_free(fmt_msg, TRUE);
va_end(arg);
}
void