1
0
Fork 0

Remove win_print, use win_printf instead

This commit is contained in:
James Booth 2016-10-11 23:38:59 +01:00
parent 0337c5b22c
commit 0890179fc4
13 changed files with 230 additions and 242 deletions

View File

@ -1481,7 +1481,7 @@ _cmd_help_cmd_list(const char *const tag)
if (tag) {
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s commands", tag);
} else {
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "All commands");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "All commands");
}
GList *ordered_commands = NULL;
@ -3942,7 +3942,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject);
} else {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room has no subject");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room has no subject");
}
return TRUE;
}
@ -4050,7 +4050,7 @@ cmd_affiliation(ProfWin *window, const char *const command, gchar **args)
iq_room_affiliation_list(mucwin->roomjid, "member");
iq_room_affiliation_list(mucwin->roomjid, "outcast");
} else if (g_strcmp0(affiliation, "none") == 0) {
win_print((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no affiliation.");
win_printf((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no affiliation.");
} else {
iq_room_affiliation_list(mucwin->roomjid, affiliation);
}
@ -4118,7 +4118,7 @@ cmd_role(ProfWin *window, const char *const command, gchar **args)
iq_room_role_list(mucwin->roomjid, "participant");
iq_room_role_list(mucwin->roomjid, "visitor");
} else if (g_strcmp0(role, "none") == 0) {
win_print((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no role.");
win_printf((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Cannot list users with no role.");
} else {
iq_room_role_list(mucwin->roomjid, role);
}
@ -4180,12 +4180,12 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
if (g_strcmp0(args[0], "accept") == 0) {
gboolean requires_config = muc_requires_config(mucwin->roomjid);
if (!requires_config) {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Current room does not require configuration.");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Current room does not require configuration.");
return TRUE;
} else {
iq_confirm_instant_room(mucwin->roomjid);
muc_set_requires_config(mucwin->roomjid, FALSE);
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room unlocked.");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room unlocked.");
return TRUE;
}
}
@ -4687,7 +4687,7 @@ cmd_tiny(ProfWin *window, const char *const command, gchar **args)
char *tiny = tinyurl_get(url);
if (!tiny) {
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", "Couldn't create tinyurl.");
win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", "Couldn't create tinyurl.");
return TRUE;
}

View File

@ -85,7 +85,7 @@ api_cons_show_themed(const char *const group, const char *const key, const char
char *parsed = str_replace(message, "\r\n", "\n");
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, 0, themeitem, "", parsed);
win_printf(console, '-', 0, NULL, 0, themeitem, "", parsed);
free(parsed);
@ -368,7 +368,7 @@ api_win_show(const char *tag, const char *line)
}
ProfWin *window = (ProfWin*)pluginwin;
win_print(window, '!', 0, NULL, 0, 0, "", line);
win_printf(window, '!', 0, NULL, 0, 0, "", line);
return 1;
}
@ -393,7 +393,7 @@ api_win_show_themed(const char *tag, const char *const group, const char *const
theme_item_t themeitem = plugin_themes_get(group, key, def);
ProfWin *window = (ProfWin*)pluginwin;
win_print(window, '!', 0, NULL, 0, themeitem, "", line);
win_printf(window, '!', 0, NULL, 0, themeitem, "", line);
return 1;
}

View File

@ -96,9 +96,9 @@ chatwin_otr_secured(ProfChatWin *chatwin, gboolean trusted)
ProfWin *window = (ProfWin*) chatwin;
if (trusted) {
win_print(window, '!', 0, NULL, 0, THEME_OTR_STARTED_TRUSTED, "", "OTR session started (trusted).");
win_printf(window, '!', 0, NULL, 0, THEME_OTR_STARTED_TRUSTED, "", "OTR session started (trusted).");
} else {
win_print(window, '!', 0, NULL, 0, THEME_OTR_STARTED_UNTRUSTED, "", "OTR session started (untrusted).");
win_printf(window, '!', 0, NULL, 0, THEME_OTR_STARTED_UNTRUSTED, "", "OTR session started (untrusted).");
}
if (wins_is_current(window)) {
@ -125,7 +125,7 @@ chatwin_otr_unsecured(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_ENDED, "", "OTR session ended.");
win_printf(window, '!', 0, NULL, 0, THEME_OTR_ENDED, "", "OTR session ended.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -188,7 +188,7 @@ chatwin_otr_trust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted.");
win_printf(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -203,7 +203,7 @@ chatwin_otr_untrust(ProfChatWin *chatwin)
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted.");
win_printf(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
@ -308,7 +308,7 @@ chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id,
if (request_receipt && id) {
win_print_with_receipt((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message, id);
} else {
win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
win_printf((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
}
}
@ -322,7 +322,7 @@ chatwin_outgoing_carbon(ProfChatWin *chatwin, const char *const message, prof_en
enc_char = prefs_get_pgp_char();
}
win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
win_printf((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
int num = wins_get_num((ProfWin*)chatwin);
status_bar_active(num);
}
@ -401,11 +401,11 @@ _chatwin_history(ProfChatWin *chatwin, const char *const contact)
char mm[3]; memcpy(mm, &line[3], 2); mm[2] = '\0'; int imm = atoi(mm);
char ss[3]; memcpy(ss, &line[6], 2); ss[2] = '\0'; int iss = atoi(ss);
GDateTime *timestamp = g_date_time_new_local(2000, 1, 1, ihh, imm, iss);
win_print((ProfWin*)chatwin, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", curr->data+11);
win_printf((ProfWin*)chatwin, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", curr->data+11);
g_date_time_unref(timestamp);
// header
} else {
win_print((ProfWin*)chatwin, '-', 0, NULL, 0, 0, "", curr->data);
win_printf((ProfWin*)chatwin, '-', 0, NULL, 0, 0, "", curr->data);
}
curr = g_slist_next(curr);
}

View File

@ -67,14 +67,14 @@ void
cons_show_time(void)
{
ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, NO_EOL, 0, "", "");
win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "");
}
void
cons_show_word(const char *const word)
{
ProfWin *console = wins_get_console();
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", word);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", word);
}
void
@ -125,19 +125,19 @@ cons_show_help(const char *const cmd, CommandHelp *help)
cons_show("");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s", &cmd[1]);
win_print(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", "");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", "");
int i;
for (i = 0; i < strlen(cmd) - 1 ; i++) {
win_print(console, '-', 0, NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-");
win_printf(console, '-', 0, NULL, NO_EOL | NO_DATE, THEME_WHITE_BOLD, "", "-");
}
win_print(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", "");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", "");
cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Synopsis");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Synopsis");
ui_show_lines(console, help->synopsis);
cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Description");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Description");
win_println(console, 0, help->desc);
int maxlen = 0;
@ -148,7 +148,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (i > 0) {
cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Arguments");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Arguments");
for (i = 0; help->args[i][0] != NULL; i++) {
win_printf(console, '-', maxlen + 3, NULL, 0, 0, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]);
}
@ -156,7 +156,7 @@ cons_show_help(const char *const cmd, CommandHelp *help)
if (g_strv_length((gchar**)help->examples) > 0) {
cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Examples");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Examples");
ui_show_lines(console, help->examples);
}
}
@ -181,7 +181,7 @@ cons_show_error(const char *const msg, ...)
va_start(arg, msg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_print(console, '-', 0, NULL, 0, THEME_ERROR, "", fmt_msg->str);
win_printf(console, '-', 0, NULL, 0, THEME_ERROR, "", fmt_msg->str);
g_string_free(fmt_msg, TRUE);
va_end(arg);
@ -484,7 +484,7 @@ cons_show_login_success(ProfAccount *account, gboolean secured)
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)",
accounts_get_priority_for_presence_type(account->name, presence));
win_print(console, '-', 0, NULL, NO_DATE, 0, "", ".");
win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ".");
if (!secured) {
cons_show_error("TLS connection not established");
}
@ -555,26 +555,26 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence)
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid);
win_print(console, '-', 0, NULL, NO_DATE, 0, "", ":");
win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ":");
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_print(console, '-', 0, NULL, NO_EOL, 0, "", "Identity: ");
win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "Identity: ");
if (identity->name) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
}
}
if (identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
}
}
if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
}
win_newline(console);
}
@ -706,10 +706,10 @@ cons_show_bookmarks(const GList *list)
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick);
}
if (item->autojoin) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)");
}
if (item->password) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (private)");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (private)");
}
if (muc_active(item->barejid)) {
ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid);
@ -1014,21 +1014,21 @@ cons_show_account(ProfAccount *account)
// show identity
if (caps->identity) {
DiscoIdentity *identity = caps->identity;
win_print(console, '-', 0, NULL, NO_EOL, 0, "", " Identity: ");
win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " Identity: ");
if (identity->name) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->name);
if (identity->category || identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
}
}
if (identity->type) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->type);
if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " ");
}
}
if (identity->category) {
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", identity->category);
}
win_newline(console);
}
@ -2078,7 +2078,7 @@ cons_navigation_help(void)
{
ProfWin *console = wins_get_console();
cons_show("");
win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Navigation");
win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Navigation");
cons_show("Alt-1..Alt-0, F1..F10 : Choose window.");
cons_show("Alt-LEFT, Alt-RIGHT : Previous/next chat window.");
cons_show("PAGEUP, PAGEDOWN : Page the main window.");
@ -2184,15 +2184,15 @@ _cons_theme_bar_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop);
win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
g_string_free(propstr, TRUE);
GString *valstr = g_string_new(" ");
char *setting = theme_get_string(prop);
g_string_append_printf(valstr, "%s ", setting);
theme_free_string(setting);
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, theme, "", valstr->str);
win_print(console, '-', 0, NULL, NO_DATE, THEME_TEXT, "", "");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, theme, "", valstr->str);
win_printf(console, '-', 0, NULL, NO_DATE, THEME_TEXT, "", "");
g_string_free(valstr, TRUE);
}
@ -2203,22 +2203,15 @@ _cons_theme_prop(theme_item_t theme, char *prop)
GString *propstr = g_string_new(" ");
g_string_append_printf(propstr, "%-24s", prop);
win_print(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
win_printf(console, '-', 0, NULL, NO_EOL, THEME_TEXT, "", propstr->str);
g_string_free(propstr, TRUE);
GString *valstr = g_string_new("");
char *setting = theme_get_string(prop);
g_string_append_printf(valstr, "%s", setting);
theme_free_string(setting);
win_print(console, '-', 0, NULL, NO_DATE, theme, "", valstr->str);
win_printf(console, '-', 0, NULL, NO_DATE, theme, "", valstr->str);
g_string_free(valstr, TRUE);
// GString *str = g_string_new(" ");
// char *setting = theme_get_string(prop);
// g_string_append_printf(str, "%-24s%s", prop, setting);
// theme_free_string(setting);
// win_print(console, '-', 0, NULL, 0, theme, "", str->str);
// g_string_free(str, TRUE);
}
void
@ -2332,22 +2325,22 @@ cons_theme_colours(void)
ProfWin *console = wins_get_console();
cons_show("Available colours:");
win_print(console, '-', 0, NULL, NO_EOL, THEME_WHITE, "", " white ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white");
win_print(console, '-', 0, NULL, NO_EOL, THEME_GREEN, "", " green ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green");
win_print(console, '-', 0, NULL, NO_EOL, THEME_RED, "", " red ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red");
win_print(console, '-', 0, NULL, NO_EOL, THEME_YELLOW, "", " yellow ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow");
win_print(console, '-', 0, NULL, NO_EOL, THEME_BLUE, "", " blue ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue");
win_print(console, '-', 0, NULL, NO_EOL, THEME_CYAN, "", " cyan ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan");
win_print(console, '-', 0, NULL, NO_EOL, THEME_MAGENTA, "", " magenta ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta");
win_print(console, '-', 0, NULL, NO_EOL, THEME_BLACK, "", " black ");
win_print(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_WHITE, "", " white ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_WHITE_BOLD, "", " bold_white");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_GREEN, "", " green ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_GREEN_BOLD, "", " bold_green");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_RED, "", " red ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_RED_BOLD, "", " bold_red");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_YELLOW, "", " yellow ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_YELLOW_BOLD, "", " bold_yellow");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLUE, "", " blue ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLUE_BOLD, "", " bold_blue");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_CYAN, "", " cyan ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_CYAN_BOLD, "", " bold_cyan");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_MAGENTA, "", " magenta ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_MAGENTA_BOLD, "", " bold_magenta");
win_printf(console, '-', 0, NULL, NO_EOL, THEME_BLACK, "", " black ");
win_printf(console, '-', 0, NULL, NO_DATE, THEME_BLACK_BOLD, "", " bold_black");
cons_show("");
}
@ -2357,14 +2350,14 @@ _cons_splash_logo(void)
ProfWin *console = wins_get_console();
win_println(console, 0, "Welcome to");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ___ _ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " / __) (_)_ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ____ ____ ___ | |__ ____ ____ _| |_ _ _ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| | | | | | |_| | | ( ( | | | | | | |_| |_| |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "|_| (____/ ");
win_print(console, '-', 0, NULL, 0, THEME_SPLASH, "", "");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ___ _ ");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " / __) (_)_ ");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", " ____ ____ ___ | |__ ____ ____ _| |_ _ _ ");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| | | | | | |_| | | ( ( | | | | | | |_| |_| |");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "|_| (____/ ");
win_printf(console, '-', 0, NULL, 0, THEME_SPLASH, "", "");
if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION
@ -2404,7 +2397,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
g_string_free(title, TRUE);
win_print(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " - ");
win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " - ");
GString *sub = g_string_new("");
sub = g_string_append(sub, p_contact_subscription(contact));
if (p_contact_pending_out(contact)) {
@ -2441,7 +2434,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
win_printf(console, '-', 0, NULL, NO_DATE, 0, "", "%s", groups_str->str);
g_string_free(groups_str, TRUE);
} else {
win_print(console, '-', 0, NULL, NO_DATE, 0, "", " ");
win_printf(console, '-', 0, NULL, NO_DATE, 0, "", " ");
}
}

View File

@ -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_print((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", message);
win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", 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_print(current, show_char, 0, NULL, 0, attrs, "", fmt_msg->str);
win_printf(current, show_char, 0, NULL, 0, attrs, "", fmt_msg->str);
va_end(arg);
g_string_free(fmt_msg, TRUE);
}
@ -760,14 +760,14 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char *con
void
ui_win_error_line(ProfWin *window, const char *const msg)
{
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", msg);
win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", msg);
}
void
ui_current_error_line(const char *const msg)
{
ProfWin *current = wins_get_current();
win_print(current, '-', 0, NULL, 0, THEME_ERROR, "", msg);
win_printf(current, '-', 0, NULL, 0, THEME_ERROR, "", msg);
}
void
@ -813,7 +813,7 @@ ui_room_join(const char *const roomjid, gboolean focus)
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation);
}
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
if (focus) {
@ -1028,13 +1028,13 @@ ui_ask_pgp_passphrase(const char *hint, int prev_fail)
win_println(current, 0, "");
if (prev_fail) {
win_print(current, '!', 0, NULL, 0, 0, "", "Incorrect passphrase");
win_printf(current, '!', 0, NULL, 0, 0, "", "Incorrect passphrase");
}
if (hint) {
win_printf(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase for %s", hint);
} else {
win_print(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase");
win_printf(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase");
}
ui_update();
@ -1158,7 +1158,7 @@ ui_handle_room_configuration_form_error(const char *const roomjid, const char *c
g_string_append(message_str, message);
}
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
g_string_free(message_str, TRUE);
}
@ -1182,7 +1182,7 @@ ui_handle_room_config_submit_result(const char *const roomjid)
if (muc_window) {
ui_focus_win((ProfWin*)muc_window);
win_print(muc_window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room configuration successful");
win_printf(muc_window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room configuration successful");
} else {
ProfWin *console = wins_get_console();
ui_focus_win(console);
@ -1211,13 +1211,13 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char
if (message) {
win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else {
win_print(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
win_printf(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
}
} else if (muc_window) {
if (message) {
win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else {
win_print(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
win_printf(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
}
} else {
if (message) {
@ -1227,7 +1227,7 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char
}
}
} else {
win_print(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error");
}
}
@ -1237,7 +1237,7 @@ ui_show_lines(ProfWin *window, gchar** lines)
if (lines) {
int i;
for (i = 0; lines[i] != NULL; i++) {
win_print(window, '-', 0, NULL, 0, 0, "", lines[i]);
win_printf(window, '-', 0, NULL, 0, 0, "", lines[i]);
}
}
}
@ -1274,7 +1274,7 @@ ui_handle_software_version_error(const char *const roomjid, const char *const me
g_string_append(message_str, message);
}
win_print(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", message_str->str);
g_string_free(message_str, TRUE);
}
@ -1317,7 +1317,7 @@ ui_show_software_version(const char *const jid, const char *const presence,
win_println(window, 0, "");
theme_item_t presence_colour = theme_main_presence_attrs(presence);
win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid);
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":");
win_printf(window, '-', 0, NULL, NO_DATE, 0, "", ":");
}
if (name) {
win_printf(window, '-', 0, NULL, 0, 0, "", "Name : %s", name);

View File

@ -47,12 +47,12 @@ mucconfwin_show_form(ProfMucConfWin *confwin)
{
ProfWin *window = (ProfWin*) confwin;
if (confwin->form->title) {
win_print(window, '-', 0, NULL, NO_EOL, 0, "", "Form title: ");
win_print(window, '-', 0, NULL, NO_DATE, 0, "", confwin->form->title);
win_printf(window, '-', 0, NULL, NO_EOL, 0, "", "Form title: ");
win_printf(window, '-', 0, NULL, NO_DATE, 0, "", confwin->form->title);
} else {
win_printf(window, '-', 0, NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid);
}
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
mucconfwin_form_help(confwin);
@ -64,7 +64,7 @@ mucconfwin_show_form(ProfMucConfWin *confwin)
if ((g_strcmp0(field->type, "fixed") == 0) && field->values) {
if (field->values) {
char *value = field->values->data;
win_print(window, '-', 0, NULL, 0, 0, "", value);
win_printf(window, '-', 0, NULL, 0, 0, "", value);
}
} else if (g_strcmp0(field->type, "hidden") != 0 && field->var) {
char *tag = g_hash_table_lookup(confwin->form->var_to_tag, field->var);
@ -96,11 +96,11 @@ mucconfwin_handle_configuration(ProfMucConfWin *confwin, DataForm *form)
mucconfwin_show_form(confwin);
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_print(window, '-', 0, NULL, 0, 0, "", "Use '/form submit' to save changes.");
win_print(window, '-', 0, NULL, 0, 0, "", "Use '/form cancel' to cancel changes.");
win_print(window, '-', 0, NULL, 0, 0, "", "See '/form help' for more information.");
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "Use '/form submit' to save changes.");
win_printf(window, '-', 0, NULL, 0, 0, "", "Use '/form cancel' to cancel changes.");
win_printf(window, '-', 0, NULL, 0, 0, "", "See '/form help' for more information.");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
}
void
@ -111,11 +111,11 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
ProfWin *window = (ProfWin*) confwin;
FormField *field = form_get_field_by_tag(confwin->form, tag);
if (field) {
win_print(window, '-', 0, NULL, NO_EOL, 0, "", field->label);
win_printf(window, '-', 0, NULL, NO_EOL, 0, "", field->label);
if (field->required) {
win_print(window, '-', 0, NULL, NO_DATE, 0, "", " (Required):");
win_printf(window, '-', 0, NULL, NO_DATE, 0, "", " (Required):");
} else {
win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":");
win_printf(window, '-', 0, NULL, NO_DATE, 0, "", ":");
}
if (field->description) {
win_printf(window, '-', 0, NULL, 0, 0, "", " Description : %s", field->description);
@ -130,12 +130,12 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
case FIELD_TEXT_SINGLE:
case FIELD_TEXT_PRIVATE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
break;
case FIELD_TEXT_MULTI:
num_values = form_get_value_count(confwin->form, tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is any text");
if (num_values > 0) {
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values);
@ -143,11 +143,11 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
break;
case FIELD_BOOLEAN:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'");
break;
case FIELD_LIST_SINGLE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options;
while (curr_option) {
option = curr_option->data;
@ -158,7 +158,7 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
case FIELD_LIST_MULTI:
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options;
while (curr_option) {
option = curr_option->data;
@ -168,12 +168,12 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag)
break;
case FIELD_JID_SINGLE:
win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break;
case FIELD_JID_MULTI:
win_printf(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_printf(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
win_printf(window, '-', 0, NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break;
case FIELD_FIXED:
case FIELD_UNKNOWN:
@ -193,9 +193,9 @@ mucconfwin_form_help(ProfMucConfWin *confwin)
if (confwin->form->instructions) {
ProfWin *window = (ProfWin*) confwin;
win_print(window, '-', 0, NULL, 0, 0, "", "Supplied instructions:");
win_print(window, '-', 0, NULL, 0, 0, "", confwin->form->instructions);
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "Supplied instructions:");
win_printf(window, '-', 0, NULL, 0, 0, "", confwin->form->instructions);
win_printf(window, '-', 0, NULL, 0, 0, "", "");
}
}
@ -205,9 +205,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
win_printf(window, '-', 0, NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag);
win_printf(window, '-', 0, NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label);
if (field->required) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (required): ");
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (required): ");
} else {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ": ");
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ": ");
}
GSList *values = field->values;
@ -221,9 +221,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
char *value = curr_value->data;
if (value) {
if (g_strcmp0(field->var, "muc#roomconfig_roomsecret") == 0) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
} else {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
}
}
}
@ -233,7 +233,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) {
char *value = curr_value->data;
if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", "[hidden]");
}
}
win_newline(window);
@ -252,16 +252,16 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
break;
case FIELD_BOOLEAN:
if (curr_value == NULL) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else {
char *value = curr_value->data;
if (value == NULL) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else {
if (g_strcmp0(value, "0") == 0) {
win_print(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
win_printf(window, '-', 0, NULL, NO_DATE, THEME_OFFLINE, "", "FALSE");
} else {
win_print(window, '-', 0, NULL, NO_DATE, THEME_ONLINE, "", "TRUE");
win_printf(window, '-', 0, NULL, NO_DATE, THEME_ONLINE, "", "TRUE");
}
}
}
@ -303,7 +303,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) {
char *value = curr_value->data;
if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", value);
}
}
win_newline(window);
@ -320,7 +320,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field)
if (curr_value) {
char *value = curr_value->data;
if (value) {
win_print(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", value);
win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", value);
}
}
win_newline(window);

View File

@ -58,7 +58,7 @@ mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -75,7 +75,7 @@ mucwin_affiliation_change(ProfMucWin *mucwin, const char *const affiliation, con
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -92,7 +92,7 @@ mucwin_role_and_affiliation_change(ProfMucWin *mucwin, const char *const role, c
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
@ -110,7 +110,7 @@ mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, const ch
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -127,7 +127,7 @@ mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, c
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -144,7 +144,7 @@ mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *cons
if (reason) {
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -154,7 +154,7 @@ mucwin_room_info_error(ProfMucWin *mucwin, const char *const error)
ProfWin *window = (ProfWin*)mucwin;
win_printf(window, '!', 0, NULL, 0, 0, "", "Room info request failed: %s", error);
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
}
void
@ -166,7 +166,7 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features)
if ((identities && (g_slist_length(identities) > 0)) ||
(features && (g_slist_length(features) > 0))) {
if (identities) {
win_print(window, '!', 0, NULL, 0, 0, "", "Identities:");
win_printf(window, '!', 0, NULL, 0, 0, "", "Identities:");
}
while (identities) {
DiscoIdentity *identity = identities->data; // anme trpe, cat
@ -182,19 +182,19 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features)
if (identity->category) {
identity_str = g_string_append(identity_str, identity->category);
}
win_print(window, '!', 0, NULL, 0, 0, "", identity_str->str);
win_printf(window, '!', 0, NULL, 0, 0, "", identity_str->str);
g_string_free(identity_str, TRUE);
identities = g_slist_next(identities);
}
if (features) {
win_print(window, '!', 0, NULL, 0, 0, "", "Features:");
win_printf(window, '!', 0, NULL, 0, 0, "", "Features:");
}
while (features) {
win_printf(window, '!', 0, NULL, 0, 0, "", " %s", features->data);
features = g_slist_next(features);
}
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
}
}
@ -206,7 +206,7 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence)
ProfWin *window = (ProfWin*)mucwin;
if ((roster == NULL) || (g_list_length(roster) == 0)) {
if (presence == NULL) {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty.");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty.");
} else {
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence);
}
@ -226,12 +226,12 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence)
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick);
if (roster->next) {
win_print(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", ");
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", ");
}
roster = g_list_next(roster);
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ONLINE, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ONLINE, "", "");
}
}
@ -305,7 +305,7 @@ mucwin_occupant_online(ProfMucWin *mucwin, const char *const nick, const char *c
win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation);
}
}
win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
win_printf(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", "");
}
void
@ -355,7 +355,7 @@ mucwin_history(ProfMucWin *mucwin, const char *const nick, GDateTime *timestamp,
g_string_append(line, message);
}
win_print(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str);
win_printf(window, '-', 0, timestamp, NO_COLOUR_DATE, 0, "", line->str);
g_string_free(line, TRUE);
plugins_on_room_history_message(mucwin->roomjid, nick, message, timestamp);
@ -371,10 +371,10 @@ _mucwin_print_mention(ProfWin *window, const char *const message, const char *co
pos = GPOINTER_TO_INT(curr->data);
char *before_str = g_strndup(message + last_pos, pos - last_pos);
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION, "", before_str);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION, "", before_str);
g_free(before_str);
char *nick_str = g_strndup(message + pos, strlen(nick));
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION_TERM, "", nick_str);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMMENTION_TERM, "", nick_str);
g_free(nick_str);
last_pos = pos + strlen(nick);
@ -382,9 +382,9 @@ _mucwin_print_mention(ProfWin *window, const char *const message, const char *co
curr = g_slist_next(curr);
}
if (last_pos < strlen(message)) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", &message[last_pos]);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", &message[last_pos]);
} else {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", "");
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMMENTION, "", "");
}
}
@ -442,7 +442,7 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
// no triggers found
if (first_trigger_pos == -1) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER, "", message);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER, "", message);
} else {
if (first_trigger_pos > 0) {
char message_section[strlen(message) + 1];
@ -452,7 +452,7 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
i++;
}
message_section[i] = '\0';
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER, "", message_section);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER, "", message_section);
}
char trigger_section[first_trigger_len + 1];
int i = 0;
@ -463,10 +463,10 @@ _mucwin_print_triggers(ProfWin *window, const char *const message, GList *trigge
trigger_section[i] = '\0';
if (first_trigger_pos + first_trigger_len < strlen(message)) {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER_TERM, "", trigger_section);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME | NO_EOL, THEME_ROOMTRIGGER_TERM, "", trigger_section);
_mucwin_print_triggers(window, &message[first_trigger_pos + first_trigger_len], triggers);
} else {
win_print(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER_TERM, "", trigger_section);
win_printf(window, '-', 0, NULL, NO_DATE | NO_ME, THEME_ROOMTRIGGER_TERM, "", trigger_section);
}
}
}
@ -481,16 +481,16 @@ mucwin_message(ProfMucWin *mucwin, const char *const nick, const char *const mes
if (g_strcmp0(nick, mynick) != 0) {
if (g_slist_length(mentions) > 0) {
win_print(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMMENTION, nick, "");
win_printf(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMMENTION, nick, "");
_mucwin_print_mention(window, message, mynick, mentions);
} else if (triggers) {
win_print(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMTRIGGER, nick, "");
win_printf(window, '-', 0, NULL, NO_ME | NO_EOL, THEME_ROOMTRIGGER, nick, "");
_mucwin_print_triggers(window, message, triggers);
} else {
win_print(window, '-', 0, NULL, NO_ME, THEME_TEXT_THEM, nick, message);
win_printf(window, '-', 0, NULL, NO_ME, THEME_TEXT_THEM, nick, message);
}
} else {
win_print(window, '-', 0, NULL, 0, THEME_TEXT_ME, nick, message);
win_printf(window, '-', 0, NULL, 0, THEME_TEXT_ME, nick, message);
}
}
@ -506,12 +506,12 @@ mucwin_requires_config(ProfMucWin *mucwin)
ui_index = 0;
}
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room locked, requires configuration.");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room accept' to accept the defaults");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room destroy' to cancel and destroy the room");
win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room config' to edit the room configuration");
win_print(window, '-', 0, NULL, 0, 0, "", "");
win_printf(window, '-', 0, NULL, 0, 0, "", "");
// currently in groupchat window
if (wins_is_current(window)) {