diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/chatwin.c | 2 | ||||
-rw-r--r-- | src/ui/console.c | 100 | ||||
-rw-r--r-- | src/ui/core.c | 46 | ||||
-rw-r--r-- | src/ui/mucconfwin.c | 50 | ||||
-rw-r--r-- | src/ui/mucwin.c | 128 | ||||
-rw-r--r-- | src/ui/privwin.c | 18 | ||||
-rw-r--r-- | src/ui/ui.h | 2 | ||||
-rw-r--r-- | src/ui/window.c | 62 | ||||
-rw-r--r-- | src/ui/window_list.c | 2 |
9 files changed, 205 insertions, 205 deletions
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 9098d4cc..7ea985ea 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -227,7 +227,7 @@ chatwin_recipient_gone(ProfChatWin *chatwin) display_usr = chatwin->barejid; } - win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_GONE, "", "<- %s has left the conversation.", display_usr); + win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_GONE, "", "<- %s has left the conversation.", display_usr); } void diff --git a/src/ui/console.c b/src/ui/console.c index 98967206..139d0bb3 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -124,7 +124,7 @@ cons_show_help(const char *const cmd, CommandHelp *help) ProfWin *console = wins_get_console(); cons_show(""); - win_vprint(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s", &cmd[1]); + win_printf(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s", &cmd[1]); win_print(console, '-', 0, NULL, NO_EOL, THEME_WHITE_BOLD, "", ""); int i; for (i = 0; i < strlen(cmd) - 1 ; i++) { @@ -150,7 +150,7 @@ cons_show_help(const char *const cmd, CommandHelp *help) cons_show(""); win_print(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "Arguments"); for (i = 0; help->args[i][0] != NULL; i++) { - win_vprint(console, '-', maxlen + 3, NULL, 0, 0, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]); + win_printf(console, '-', maxlen + 3, NULL, 0, 0, "", "%-*s: %s", maxlen + 1, help->args[i][0], help->args[i][1]); } } @@ -296,7 +296,7 @@ cons_show_typing(const char *const barejid) display_usr = barejid; } - win_vprint(console, '-', 0, NULL, 0, THEME_TYPING, "", "!! %s is typing a message...", display_usr); + win_printf(console, '-', 0, NULL, 0, THEME_TYPING, "", "!! %s is typing a message...", display_usr); cons_alert(); } @@ -333,27 +333,27 @@ cons_show_incoming_room_message(const char *const nick, const char *const room, if (g_strcmp0(muc_show, "all") == 0) { if (mention) { - win_vprint(console, '-', 0, NULL, 0, THEME_MENTION, "", "<< room mention: %s in %s (win %d)", nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_MENTION, "", "<< room mention: %s in %s (win %d)", nick, room, ui_index); } else if (triggers) { char *triggers_str = _room_triggers_to_string(triggers); - win_vprint(console, '-', 0, NULL, 0, THEME_TRIGGER, "", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_TRIGGER, "", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index); free(triggers_str); } else { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s in %s (win %d)", nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s in %s (win %d)", nick, room, ui_index); } cons_alert(); } else if (g_strcmp0(muc_show, "first") == 0) { if (mention) { - win_vprint(console, '-', 0, NULL, 0, THEME_MENTION, "", "<< room mention: %s in %s (win %d)", nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_MENTION, "", "<< room mention: %s in %s (win %d)", nick, room, ui_index); cons_alert(); } else if (triggers) { char *triggers_str = _room_triggers_to_string(triggers); - win_vprint(console, '-', 0, NULL, 0, THEME_TRIGGER, "", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_TRIGGER, "", "<< room trigger %s: %s in %s (win %d)", triggers_str, nick, room, ui_index); free(triggers_str); cons_alert(); } else if (unread == 0) { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s (win %d)", room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< room message: %s (win %d)", room, ui_index); cons_alert(); } } @@ -372,10 +372,10 @@ cons_show_incoming_message(const char *const short_from, const int win_index, in char *chat_show = prefs_get_string(PREF_CONSOLE_CHAT); if (g_strcmp0(chat_show, "all") == 0) { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< chat message: %s (win %d)", short_from, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< chat message: %s (win %d)", short_from, ui_index); cons_alert(); } else if ((g_strcmp0(chat_show, "first") == 0) && unread == 0) { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< chat message: %s (win %d)", short_from, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< chat message: %s (win %d)", short_from, ui_index); cons_alert(); } @@ -394,10 +394,10 @@ cons_show_incoming_private_message(const char *const nick, const char *const roo char *priv_show = prefs_get_string(PREF_CONSOLE_PRIVATE); if (g_strcmp0(priv_show, "all") == 0) { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< private message: %s in %s (win %d)", nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< private message: %s in %s (win %d)", nick, room, ui_index); cons_alert(); } else if ((g_strcmp0(priv_show, "first") == 0) && unread == 0) { - win_vprint(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< private message: %s in %s (win %d)", nick, room, ui_index); + win_printf(console, '-', 0, NULL, 0, THEME_INCOMING, "", "<< private message: %s in %s (win %d)", nick, room, ui_index); cons_alert(); } @@ -417,16 +417,16 @@ cons_about(void) if (strcmp(PACKAGE_STATUS, "development") == 0) { #ifdef HAVE_GIT_VERSION - win_vprint(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); #else - win_vprint(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %sdev", PACKAGE_VERSION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %sdev", PACKAGE_VERSION); #endif } else { - win_vprint(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %s", PACKAGE_VERSION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Welcome to Profanity, version %s", PACKAGE_VERSION); } } - win_vprint(console, '-', 0, NULL, 0, 0, "", "Copyright (C) 2012 - 2016 James Booth <%s>.", PACKAGE_BUGREPORT); + win_printf(console, '-', 0, NULL, 0, 0, "", "Copyright (C) 2012 - 2016 James Booth <%s>.", PACKAGE_BUGREPORT); win_println(console, 0, "License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>"); win_println(console, 0, ""); win_println(console, 0, "This is free software; you are free to change and redistribute it."); @@ -455,7 +455,7 @@ cons_check_version(gboolean not_available_msg) if (relase_valid) { if (release_is_new(latest_release)) { - win_vprint(console, '-', 0, NULL, 0, 0, "", "A new version of Profanity is available: %s", latest_release); + win_printf(console, '-', 0, NULL, 0, 0, "", "A new version of Profanity is available: %s", latest_release); win_println(console, 0, "Check <http://www.profanity.im> for details."); win_println(console, 0, ""); } else { @@ -475,14 +475,14 @@ void cons_show_login_success(ProfAccount *account, gboolean secured) { ProfWin *console = wins_get_console(); - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", "%s logged in successfully, ", account->jid); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "%s logged in successfully, ", account->jid); resource_presence_t presence = accounts_get_login_presence(account->name); const char *presence_str = string_from_resource_presence(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence_str); - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str); - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)", + 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, "", "."); if (!secured) { @@ -554,7 +554,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence) const char *resource_presence = string_from_resource_presence(presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); - win_vprint(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid); + win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", fulljid); win_print(console, '-', 0, NULL, NO_DATE, 0, "", ":"); // show identity @@ -582,19 +582,19 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence) if (caps->software_version) { SoftwareVersion *software_version = caps->software_version; if (software_version->software) { - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", "Software: %s", software_version->software); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "Software: %s", software_version->software); } if (software_version->software_version) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); } if (software_version->software || software_version->software_version) { win_newline(console); } if (software_version->os) { - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", "OS: %s", software_version->os); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", "OS: %s", software_version->os); } if (software_version->os_version) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); } if (software_version->os || software_version->os_version) { win_newline(console); @@ -605,7 +605,7 @@ cons_show_caps(const char *const fulljid, resource_presence_t presence) win_println(console, 0, "Features:"); GSList *feature = caps->features; while (feature) { - win_vprint(console, '-', 0, NULL, 0, 0, "", " %s", feature->data); + win_printf(console, '-', 0, NULL, 0, 0, "", " %s", feature->data); feature = g_slist_next(feature); } } @@ -667,9 +667,9 @@ cons_show_room_list(GSList *rooms, const char *const conference_node) cons_show("Chat rooms at %s:", conference_node); while (rooms) { DiscoItem *room = rooms->data; - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", " %s", room->jid); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " %s", room->jid); if (room->name) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", room->name); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", room->name); } win_newline(console); rooms = g_slist_next(rooms); @@ -701,9 +701,9 @@ cons_show_bookmarks(const GList *list) if (muc_active(item->barejid)) { presence_colour = THEME_ONLINE; } - win_vprint(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s", item->barejid); + win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s", item->barejid); if (item->nick) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick); + 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)"); @@ -715,7 +715,7 @@ cons_show_bookmarks(const GList *list) ProfWin *roomwin = (ProfWin*)wins_get_muc(item->barejid); if (roomwin) { int num = wins_get_num(roomwin); - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (win %d)", num); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (win %d)", num); } } win_newline(console); @@ -784,11 +784,11 @@ cons_show_disco_items(GSList *items, const char *const jid) cons_show("Service discovery items for %s:", jid); while (items) { DiscoItem *item = items->data; - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", " %s", item->jid); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " %s", item->jid); if (item->name) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", item->name); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", item->name); } - win_vprint(console, '-', 0, NULL, NO_DATE, 0, "", ""); + win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ""); items = g_slist_next(items); } } else { @@ -863,7 +863,7 @@ cons_show_account_list(gchar **accounts) (g_strcmp0(session_get_account_name(), accounts[i]) == 0)) { resource_presence_t presence = accounts_get_last_presence(accounts[i]); theme_item_t presence_colour = theme_main_presence_attrs(string_from_resource_presence(presence)); - win_vprint(console, '-', 0, NULL, 0, presence_colour, "", "%s", accounts[i]); + win_printf(console, '-', 0, NULL, 0, presence_colour, "", "%s", accounts[i]); } else { cons_show(accounts[i]); } @@ -1000,12 +1000,12 @@ cons_show_account(ProfAccount *account) Resource *resource = curr->data; const char *resource_presence = string_from_resource_presence(resource->presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); - win_vprint(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); + win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); if (resource->status) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); } - win_vprint(console, '-', 0, NULL, NO_DATE, 0, "", ""); + win_printf(console, '-', 0, NULL, NO_DATE, 0, "", ""); Jid *jidp = jid_create_from_bare_and_resource(account->jid, resource->name); EntityCapabilities *caps = caps_lookup(jidp->fulljid); jid_destroy(jidp); @@ -1036,19 +1036,19 @@ cons_show_account(ProfAccount *account) if (caps->software_version) { SoftwareVersion *software_version = caps->software_version; if (software_version->software) { - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); } if (software_version->software_version) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); } if (software_version->software || software_version->software_version) { win_newline(console); } if (software_version->os) { - win_vprint(console, '-', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); + win_printf(console, '-', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); } if (software_version->os_version) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); } if (software_version->os || software_version->os_version) { win_newline(console); @@ -2368,12 +2368,12 @@ _cons_splash_logo(void) if (strcmp(PACKAGE_STATUS, "development") == 0) { #ifdef HAVE_GIT_VERSION - win_vprint(console, '-', 0, NULL, 0, 0, "", "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); #else - win_vprint(console, '-', 0, NULL, 0, 0, "", "Version %sdev", PACKAGE_VERSION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Version %sdev", PACKAGE_VERSION); #endif } else { - win_vprint(console, '-', 0, NULL, 0, 0, "", "Version %s", PACKAGE_VERSION); + win_printf(console, '-', 0, NULL, 0, 0, "", "Version %s", PACKAGE_VERSION); } } @@ -2400,7 +2400,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups) } else { presence_colour = theme_main_presence_attrs("offline"); } - win_vprint(console, '-', 0, NULL, NO_EOL, presence_colour, "", title->str); + win_printf(console, '-', 0, NULL, NO_EOL, presence_colour, "", title->str); g_string_free(title, TRUE); @@ -2420,9 +2420,9 @@ _show_roster_contacts(GSList *list, gboolean show_groups) } if (show_groups) { - win_vprint(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", sub->str); + win_printf(console, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", sub->str); } else { - win_vprint(console, '-', 0, NULL, NO_DATE, presence_colour, "", "%s", sub->str); + win_printf(console, '-', 0, NULL, NO_DATE, presence_colour, "", "%s", sub->str); } g_string_free(sub, TRUE); @@ -2438,7 +2438,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups) } groups = g_slist_next(groups); } - win_vprint(console, '-', 0, NULL, NO_DATE, 0, "", "%s", groups_str->str); + 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, "", " "); diff --git a/src/ui/core.c b/src/ui/core.c index c471aad7..7f7b3ad0 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -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_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); + win_printf((ProfWin*)chatwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); return; } ProfMucWin *mucwin = wins_get_muc(recipient); if (mucwin) { - win_vprint((ProfWin*)mucwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); + win_printf((ProfWin*)mucwin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); return; } ProfPrivateWin *privatewin = wins_get_private(recipient); if (privatewin) { - win_vprint((ProfWin*)privatewin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); + win_printf((ProfWin*)privatewin, '!', 0, NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); return; } } @@ -790,7 +790,7 @@ ui_print_system_msg_from_recipient(const char *const barejid, const char *messag } } - win_vprint(window, '-', 0, NULL, 0, 0, "", "*%s %s", barejid, message); + win_printf(window, '-', 0, NULL, 0, 0, "", "*%s %s", barejid, message); } void @@ -802,15 +802,15 @@ ui_room_join(const char *const roomjid, gboolean focus) } char *nick = muc_nick(roomjid); - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "-> You have joined the room as %s", nick); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "-> You have joined the room as %s", nick); if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { char *role = muc_role_str(roomjid); char *affiliation = muc_affiliation_str(roomjid); if (role) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", role: %s", role); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", role: %s", role); } if (affiliation) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation); } } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); @@ -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_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "-> Autojoined %s as %s (%d).", roomjid, nick, num); + win_printf(console, '!', 0, NULL, 0, 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_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s, reason: %s", roomjid, reason); + win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s, reason: %s", roomjid, reason); } else { - win_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s", roomjid); + win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s", roomjid); } if (new_jid) { if (password) { - win_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "Replacement room: %s, password: %s", new_jid, password); + win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "Replacement room: %s, password: %s", new_jid, password); } else { - win_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "Replacement room: %s", new_jid); + win_printf(console, '!', 0, NULL, 0, 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_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- %s", message->str); + win_printf(console, '!', 0, NULL, 0, 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_vprint(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- %s", message->str); + win_printf(console, '!', 0, NULL, 0, THEME_TYPING, "", "<- %s", message->str); g_string_free(message, TRUE); } @@ -1032,7 +1032,7 @@ ui_ask_pgp_passphrase(const char *hint, int prev_fail) } if (hint) { - win_vprint(current, '!', 0, NULL, 0, 0, "", "Enter PGP key passphrase for %s", 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"); } @@ -1209,21 +1209,21 @@ ui_handle_room_config_submit_result_error(const char *const roomjid, const char if (form_window) { if (message) { - win_vprint(form_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", 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"); } } else if (muc_window) { if (message) { - win_vprint(muc_window, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error: %s", 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"); } } else { if (message) { - win_vprint(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s: %s", roomjid, message); + win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s: %s", roomjid, message); } else { - win_vprint(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s", roomjid); + win_printf(console, '!', 0, NULL, 0, THEME_ERROR, "", "Configuration error for %s", roomjid); } } } else { @@ -1316,17 +1316,17 @@ ui_show_software_version(const char *const jid, const char *const presence, if (name || version || os) { win_println(window, 0, ""); theme_item_t presence_colour = theme_main_presence_attrs(presence); - win_vprint(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid); + win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s", jid); win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); } if (name) { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Name : %s", name); + win_printf(window, '-', 0, NULL, 0, 0, "", "Name : %s", name); } if (version) { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Version : %s", version); + win_printf(window, '-', 0, NULL, 0, 0, "", "Version : %s", version); } if (os) { - win_vprint(window, '-', 0, NULL, 0, 0, "", "OS : %s", os); + win_printf(window, '-', 0, NULL, 0, 0, "", "OS : %s", os); } } diff --git a/src/ui/mucconfwin.c b/src/ui/mucconfwin.c index b31bb928..3f8987b6 100644 --- a/src/ui/mucconfwin.c +++ b/src/ui/mucconfwin.c @@ -50,7 +50,7 @@ mucconfwin_show_form(ProfMucConfWin *confwin) win_print(window, '-', 0, NULL, NO_EOL, 0, "", "Form title: "); win_print(window, '-', 0, NULL, NO_DATE, 0, "", confwin->form->title); } else { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid); + win_printf(window, '-', 0, NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid); } win_print(window, '-', 0, NULL, 0, 0, "", ""); @@ -118,9 +118,9 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag) win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); } if (field->description) { - win_vprint(window, '-', 0, NULL, 0, 0, "", " Description : %s", field->description); + win_printf(window, '-', 0, NULL, 0, 0, "", " Description : %s", field->description); } - win_vprint(window, '-', 0, NULL, 0, 0, "", " Type : %s", field->type); + win_printf(window, '-', 0, NULL, 0, 0, "", " Type : %s", field->type); int num_values = 0; GSList *curr_option = NULL; @@ -129,50 +129,50 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag) switch (field->type_t) { case FIELD_TEXT_SINGLE: case FIELD_TEXT_PRIVATE: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); + win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_print(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_vprint(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", 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"); if (num_values > 0) { - win_vprint(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); - win_vprint(window, '-', 0, NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values); + 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); } break; case FIELD_BOOLEAN: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); + 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'"); break; case FIELD_LIST_SINGLE: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); + win_printf(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); win_print(window, '-', 0, NULL, 0, 0, "", " Where : <value> is one of"); curr_option = field->options; while (curr_option) { option = curr_option->data; - win_vprint(window, '-', 0, NULL, 0, 0, "", " %s", option->value); + win_printf(window, '-', 0, NULL, 0, 0, "", " %s", option->value); curr_option = g_slist_next(curr_option); } break; case FIELD_LIST_MULTI: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag); - win_vprint(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); + 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"); curr_option = field->options; while (curr_option) { option = curr_option->data; - win_vprint(window, '-', 0, NULL, 0, 0, "", " %s", option->value); + win_printf(window, '-', 0, NULL, 0, 0, "", " %s", option->value); curr_option = g_slist_next(curr_option); } break; case FIELD_JID_SINGLE: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Set : /%s <value>", tag); + 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"); break; case FIELD_JID_MULTI: - win_vprint(window, '-', 0, NULL, 0, 0, "", " Add : /%s add <value>", tag); - win_vprint(window, '-', 0, NULL, 0, 0, "", " Remove : /%s remove <value>", tag); + 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"); break; case FIELD_FIXED: @@ -182,7 +182,7 @@ mucconfwin_field_help(ProfMucConfWin *confwin, char *tag) break; } } else { - win_vprint(window, '-', 0, NULL, 0, 0, "", "No such field %s", tag); + win_printf(window, '-', 0, NULL, 0, 0, "", "No such field %s", tag); } } @@ -202,8 +202,8 @@ mucconfwin_form_help(ProfMucConfWin *confwin) static void _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) { - win_vprint(window, '-', 0, NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag); - win_vprint(window, '-', 0, NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label); + 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): "); } else { @@ -245,7 +245,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) char *value = curr_value->data; GString *val_tag = g_string_new(""); g_string_printf(val_tag, "val%d", index++); - win_vprint(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", val_tag->str, value); + win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", val_tag->str, value); g_string_free(val_tag, TRUE); curr_value = g_slist_next(curr_value); } @@ -275,9 +275,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) while (curr_option) { FormOption *option = curr_option->data; if (g_strcmp0(option->value, value) == 0) { - win_vprint(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); + win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); } else { - win_vprint(window, '-', 0, NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); + win_printf(window, '-', 0, NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); } curr_option = g_slist_next(curr_option); } @@ -291,9 +291,9 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) while (curr_option) { FormOption *option = curr_option->data; if (g_slist_find_custom(curr_value, option->value, (GCompareFunc)g_strcmp0)) { - win_vprint(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); + win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); } else { - win_vprint(window, '-', 0, NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); + win_printf(window, '-', 0, NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); } curr_option = g_slist_next(curr_option); } @@ -312,7 +312,7 @@ _mucconfwin_form_field(ProfWin *window, char *tag, FormField *field) win_newline(window); while (curr_value) { char *value = curr_value->data; - win_vprint(window, '-', 0, NULL, 0, THEME_ONLINE, "", " %s", value); + win_printf(window, '-', 0, NULL, 0, THEME_ONLINE, "", " %s", value); curr_value = g_slist_next(curr_value); } break; diff --git a/src/ui/mucwin.c b/src/ui/mucwin.c index 3f773431..8bb67790 100644 --- a/src/ui/mucwin.c +++ b/src/ui/mucwin.c @@ -51,12 +51,12 @@ mucwin_role_change(ProfMucWin *mucwin, const char *const role, const char *const assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your role has been changed to: %s", role); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your role has been changed to: %s", role); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -68,12 +68,12 @@ mucwin_affiliation_change(ProfMucWin *mucwin, const char *const affiliation, con assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your affiliation has been changed to: %s", affiliation); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your affiliation has been changed to: %s", affiliation); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -85,12 +85,12 @@ mucwin_role_and_affiliation_change(ProfMucWin *mucwin, const char *const role, c assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your role and affiliation have been changed, role: %s, affiliation: %s", role, affiliation); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Your role and affiliation have been changed, role: %s, affiliation: %s", role, affiliation); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -103,12 +103,12 @@ mucwin_occupant_role_change(ProfMucWin *mucwin, const char *const nick, const ch assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role has been changed to: %s", nick, role); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role has been changed to: %s", nick, role); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -120,12 +120,12 @@ mucwin_occupant_affiliation_change(ProfMucWin *mucwin, const char *const nick, c assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's affiliation has been changed to: %s", nick, affiliation); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's affiliation has been changed to: %s", nick, affiliation); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -137,12 +137,12 @@ mucwin_occupant_role_and_affiliation_change(ProfMucWin *mucwin, const char *cons assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role and affiliation have been changed, role: %s, affiliation: %s", nick, role, affiliation); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role and affiliation have been changed, role: %s, affiliation: %s", nick, role, affiliation); if (actor) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); } if (reason) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); } @@ -153,7 +153,7 @@ mucwin_room_info_error(ProfMucWin *mucwin, const char *const error) assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, 0, "", "Room info request failed: %s", error); + win_printf(window, '!', 0, NULL, 0, 0, "", "Room info request failed: %s", error); win_print(window, '-', 0, NULL, 0, 0, "", ""); } @@ -191,7 +191,7 @@ mucwin_room_disco_info(ProfMucWin *mucwin, GSList *identities, GSList *features) win_print(window, '!', 0, NULL, 0, 0, "", "Features:"); } while (features) { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", features->data); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", features->data); features = g_slist_next(features); } win_print(window, '-', 0, NULL, 0, 0, "", ""); @@ -208,14 +208,14 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence) if (presence == NULL) { win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room is empty."); } else { - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence); + win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence); } } else { int length = g_list_length(roster); if (presence == NULL) { - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%d occupants: ", length); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%d occupants: ", length); } else { - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%d %s: ", length, presence); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "%d %s: ", length, presence); } while (roster) { @@ -223,7 +223,7 @@ mucwin_roster(ProfMucWin *mucwin, GList *roster, const char *const presence) const char *presence_str = string_from_resource_presence(occupant->presence); theme_item_t presence_colour = theme_main_presence_attrs(presence_str); - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick); + 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, "", ", "); @@ -242,7 +242,7 @@ mucwin_occupant_offline(ProfMucWin *mucwin, const char *const nick) assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s has left the room.", nick); + win_printf(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s has left the room.", nick); } void @@ -263,7 +263,7 @@ mucwin_occupant_kicked(ProfMucWin *mucwin, const char *const nick, const char *c g_string_append(message, reason); } - win_vprint(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); + win_printf(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); g_string_free(message, TRUE); } @@ -285,7 +285,7 @@ mucwin_occupant_banned(ProfMucWin *mucwin, const char *const nick, const char *c g_string_append(message, reason); } - win_vprint(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); + win_printf(window, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); g_string_free(message, TRUE); } @@ -296,13 +296,13 @@ mucwin_occupant_online(ProfMucWin *mucwin, const char *const nick, const char *c assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ONLINE, "", "-> %s has joined the room", nick); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ONLINE, "", "-> %s has joined the room", nick); if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { if (role) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", role: %s", role); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", role: %s", role); } if (affiliation) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation); } } win_print(window, '!', 0, NULL, NO_DATE, THEME_ROOMINFO, "", ""); @@ -324,7 +324,7 @@ mucwin_occupant_nick_change(ProfMucWin *mucwin, const char *const old_nick, cons assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick); + win_printf(window, '!', 0, NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick); } void @@ -333,7 +333,7 @@ mucwin_nick_change(ProfMucWin *mucwin, const char *const nick) assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ME, "", "** You are now known as %s", nick); + win_printf(window, '!', 0, NULL, 0, THEME_ME, "", "** You are now known as %s", nick); } void @@ -507,10 +507,10 @@ mucwin_requires_config(ProfMucWin *mucwin) } win_print(window, '-', 0, NULL, 0, 0, "", ""); - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room locked, requires configuration."); - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room accept' to accept the defaults"); - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room destroy' to cancel and destroy the room"); - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Use '/room config' to edit the room configuration"); + 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, "", ""); // currently in groupchat window @@ -533,17 +533,17 @@ mucwin_subject(ProfMucWin *mucwin, const char *const nick, const char *const sub if (subject) { if (nick) { - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick); - win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick); + win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject); } else { - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: "); - win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: "); + win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", subject); } } else { if (nick) { - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject.", nick); + win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject.", nick); } else { - win_vprint(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room subject cleared"); + win_printf(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room subject cleared"); } } @@ -563,7 +563,7 @@ mucwin_kick_error(ProfMucWin *mucwin, const char *const nick, const char *const assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error kicking %s: %s", nick, error); + win_printf(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error kicking %s: %s", nick, error); } void @@ -574,8 +574,8 @@ mucwin_broadcast(ProfMucWin *mucwin, const char *const message) ProfWin *window = (ProfWin*)mucwin; int num = wins_get_num(window); - win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: "); - win_vprint(window, '!', 0, NULL, NO_DATE, 0, "", "%s", message); + win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: "); + win_printf(window, '!', 0, NULL, NO_DATE, 0, "", "%s", message); // currently in groupchat window if (wins_is_current(window)) { @@ -594,7 +594,7 @@ mucwin_affiliation_list_error(ProfMucWin *mucwin, const char *const affiliation, assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", affiliation, error); + win_printf(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", affiliation, error); } void @@ -604,16 +604,16 @@ mucwin_handle_affiliation_list(ProfMucWin *mucwin, const char *const affiliation ProfWin *window = (ProfWin*)mucwin; if (jids) { - win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); + win_printf(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); GSList *curr_jid = jids; while (curr_jid) { const char *jid = curr_jid->data; - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", jid); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", jid); curr_jid = g_slist_next(curr_jid); } win_print(window, '!', 0, NULL, 0, 0, "", ""); } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation); + win_printf(window, '!', 0, NULL, 0, 0, "", "No users found with affiliation: %s", affiliation); win_print(window, '!', 0, NULL, 0, 0, "", ""); } } @@ -667,9 +667,9 @@ mucwin_show_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation) Occupant *occupant = curr_occupant->data; if (occupant->affiliation == affiliation) { if (occupant->jid) { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", occupant->nick); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", occupant->nick); } } @@ -686,7 +686,7 @@ mucwin_role_list_error(ProfMucWin *mucwin, const char *const role, const char *c assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", role, error); + win_printf(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", role, error); } void @@ -696,25 +696,25 @@ mucwin_handle_role_list(ProfMucWin *mucwin, const char *const role, GSList *nick ProfWin *window = (ProfWin*)mucwin; if (nicks) { - win_vprint(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); + win_printf(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); GSList *curr_nick = nicks; while (curr_nick) { const char *nick = curr_nick->data; Occupant *occupant = muc_roster_item(mucwin->roomjid, nick); if (occupant) { if (occupant->jid) { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s (%s)", nick, occupant->jid); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s (%s)", nick, occupant->jid); } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", nick); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", nick); } } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", nick); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", nick); } curr_nick = g_slist_next(curr_nick); } win_print(window, '!', 0, NULL, 0, 0, "", ""); } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", "No occupants found with role: %s", role); + win_printf(window, '!', 0, NULL, 0, 0, "", "No occupants found with role: %s", role); win_print(window, '!', 0, NULL, 0, 0, "", ""); } } @@ -762,9 +762,9 @@ mucwin_show_role_list(ProfMucWin *mucwin, muc_role_t role) Occupant *occupant = curr_occupant->data; if (occupant->role == role) { if (occupant->jid) { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); } else { - win_vprint(window, '!', 0, NULL, 0, 0, "", " %s", occupant->nick); + win_printf(window, '!', 0, NULL, 0, 0, "", " %s", occupant->nick); } } @@ -782,7 +782,7 @@ mucwin_affiliation_set_error(ProfMucWin *mucwin, const char *const jid, const ch assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error); + win_printf(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error); } void @@ -792,7 +792,7 @@ mucwin_role_set_error(ProfMucWin *mucwin, const char *const nick, const char *co assert(mucwin != NULL); ProfWin *window = (ProfWin*)mucwin; - win_vprint(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error); + win_printf(window, '!', 0, NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error); } void @@ -804,9 +804,9 @@ mucwin_info(ProfMucWin *mucwin) char *affiliation = muc_affiliation_str(mucwin->roomjid); ProfWin *window = (ProfWin*) mucwin; - win_vprint(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid); - win_vprint(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); - win_vprint(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); + win_printf(window, '!', 0, NULL, 0, 0, "", "Room: %s", mucwin->roomjid); + win_printf(window, '!', 0, NULL, 0, 0, "", "Affiliation: %s", affiliation); + win_printf(window, '!', 0, NULL, 0, 0, "", "Role: %s", role); win_print(window, '-', 0, NULL, 0, 0, "", ""); } diff --git a/src/ui/privwin.c b/src/ui/privwin.c index 1caf4845..b540fb44 100644 --- a/src/ui/privwin.c +++ b/src/ui/privwin.c @@ -119,7 +119,7 @@ privwin_occupant_offline(ProfPrivateWin *privwin) privwin->occupant_offline = TRUE; Jid *jidp = jid_create(privwin->fulljid); - win_vprint((ProfWin*)privwin, '-', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s has left the room.", jidp->resourcepart); + win_printf((ProfWin*)privwin, '-', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s has left the room.", jidp->resourcepart); jid_destroy(jidp); } @@ -142,7 +142,7 @@ privwin_occupant_kicked(ProfPrivateWin *privwin, const char *const actor, const g_string_append(message, reason); } - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s", message->str); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s", message->str); g_string_free(message, TRUE); } @@ -165,7 +165,7 @@ privwin_occupant_banned(ProfPrivateWin *privwin, const char *const actor, const g_string_append(message, reason); } - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s", message->str); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "<- %s", message->str); g_string_free(message, TRUE); } @@ -176,7 +176,7 @@ privwin_occupant_online(ProfPrivateWin *privwin) privwin->occupant_offline = FALSE; Jid *jidp = jid_create(privwin->fulljid); - win_vprint((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ONLINE, NULL, "-- %s has joined the room.", jidp->resourcepart); + win_printf((ProfWin*)privwin, '-', 0, NULL, 0, THEME_ONLINE, NULL, "-- %s has joined the room.", jidp->resourcepart); jid_destroy(jidp); } @@ -187,7 +187,7 @@ privwin_room_destroyed(ProfPrivateWin *privwin) privwin->room_left = TRUE; Jid *jidp = jid_create(privwin->fulljid); - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- %s has been destroyed.", jidp->barejid); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- %s has been destroyed.", jidp->barejid); jid_destroy(jidp); } @@ -198,7 +198,7 @@ privwin_room_joined(ProfPrivateWin *privwin) privwin->room_left = FALSE; Jid *jidp = jid_create(privwin->fulljid); - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- You have joined %s.", jidp->barejid); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- You have joined %s.", jidp->barejid); jid_destroy(jidp); } @@ -209,7 +209,7 @@ privwin_room_left(ProfPrivateWin *privwin) privwin->room_left = TRUE; Jid *jidp = jid_create(privwin->fulljid); - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- You have left %s.", jidp->barejid); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, NULL, "-- You have left %s.", jidp->barejid); jid_destroy(jidp); } @@ -232,7 +232,7 @@ privwin_room_kicked(ProfPrivateWin *privwin, const char *const actor, const char g_string_append(message, reason); } - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); g_string_free(message, TRUE); } @@ -255,7 +255,7 @@ privwin_room_banned(ProfPrivateWin *privwin, const char *const actor, const char g_string_append(message, reason); } - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); g_string_free(message, TRUE); } diff --git a/src/ui/ui.h b/src/ui/ui.h index bff1c921..95e26933 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -358,7 +358,7 @@ void win_show_subwin(ProfWin *window); void win_refresh_without_subwin(ProfWin *window); void win_refresh_with_subwin(ProfWin *window); void win_print(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message); -void win_vprint(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, ...); +void win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, ...); char* win_get_title(ProfWin *window); void win_show_occupant(ProfWin *window, Occupant *occupant); void win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupant); diff --git a/src/ui/window.c b/src/ui/window.c index 4cbe25f4..ebcd9e53 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -684,10 +684,10 @@ win_show_occupant(ProfWin *window, Occupant *occupant) theme_item_t presence_colour = theme_main_presence_attrs(presence_str); win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", occupant->nick); - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); if (occupant->status) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); } win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); @@ -710,7 +710,7 @@ win_show_contact(ProfWin *window, PContact contact) win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid); } - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence); if (last_activity) { GDateTime *now = g_date_time_new_now_local(); @@ -724,15 +724,15 @@ win_show_contact(ProfWin *window, PContact contact) int seconds = span / G_TIME_SPAN_SECOND; if (hours > 0) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds); } else { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds); } } if (status) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact)); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact)); } win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); @@ -748,20 +748,20 @@ win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupa theme_item_t presence_colour = theme_main_presence_attrs(presence_str); win_print(window, '!', 0, NULL, NO_EOL, presence_colour, "", occupant->nick); - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); if (occupant->status) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); } win_newline(window); if (occupant->jid) { - win_vprint(window, '!', 0, NULL, 0, 0, "", " Jid: %s", occupant->jid); + win_printf(window, '!', 0, NULL, 0, 0, "", " Jid: %s", occupant->jid); } - win_vprint(window, '!', 0, NULL, 0, 0, "", " Affiliation: %s", occupant_affiliation); - win_vprint(window, '!', 0, NULL, 0, 0, "", " Role: %s", occupant_role); + win_printf(window, '!', 0, NULL, 0, 0, "", " Affiliation: %s", occupant_affiliation); + win_printf(window, '!', 0, NULL, 0, 0, "", " Role: %s", occupant_role); Jid *jidp = jid_create_from_bare_and_resource(room, occupant->nick); EntityCapabilities *caps = caps_lookup(jidp->fulljid); @@ -793,19 +793,19 @@ win_show_occupant_info(ProfWin *window, const char *const room, Occupant *occupa if (caps->software_version) { SoftwareVersion *software_version = caps->software_version; if (software_version->software) { - win_vprint(window, '!', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); + win_printf(window, '!', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); } if (software_version->software_version) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); } if (software_version->software || software_version->software_version) { win_newline(window); } if (software_version->os) { - win_vprint(window, '!', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); + win_printf(window, '!', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); } if (software_version->os_version) { - win_vprint(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); + win_printf(window, '!', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); } if (software_version->os || software_version->os_version) { win_newline(window); @@ -832,12 +832,12 @@ win_show_info(ProfWin *window, PContact contact) win_print(window, '-', 0, NULL, 0, 0, "", ""); win_print(window, '-', 0, NULL, NO_EOL, presence_colour, "", barejid); if (name) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name); } win_print(window, '-', 0, NULL, NO_DATE, 0, "", ":"); if (sub) { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Subscription: %s", sub); + win_printf(window, '-', 0, NULL, 0, 0, "", "Subscription: %s", sub); } if (last_activity) { @@ -851,10 +851,10 @@ win_show_info(ProfWin *window, PContact contact) int seconds = span / G_TIME_SPAN_SECOND; if (hours > 0) { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Last activity: %dh%dm%ds", hours, minutes, seconds); + win_printf(window, '-', 0, NULL, 0, 0, "", "Last activity: %dh%dm%ds", hours, minutes, seconds); } else { - win_vprint(window, '-', 0, NULL, 0, 0, "", "Last activity: %dm%ds", minutes, seconds); + win_printf(window, '-', 0, NULL, 0, 0, "", "Last activity: %dm%ds", minutes, seconds); } g_date_time_unref(now); @@ -881,9 +881,9 @@ win_show_info(ProfWin *window, PContact contact) Resource *resource = curr->data; const char *resource_presence = string_from_resource_presence(resource->presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); - win_vprint(window, '-', 0, NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); + win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); if (resource->status) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); } win_newline(window); @@ -917,19 +917,19 @@ win_show_info(ProfWin *window, PContact contact) if (caps->software_version) { SoftwareVersion *software_version = caps->software_version; if (software_version->software) { - win_vprint(window, '-', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); + win_printf(window, '-', 0, NULL, NO_EOL, 0, "", " Software: %s", software_version->software); } if (software_version->software_version) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->software_version); } if (software_version->software || software_version->software_version) { win_newline(window); } if (software_version->os) { - win_vprint(window, '-', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); + win_printf(window, '-', 0, NULL, NO_EOL, 0, "", " OS: %s", software_version->os); } if (software_version->os_version) { - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, 0, "", ", %s", software_version->os_version); } if (software_version->os || software_version->os_version) { win_newline(window); @@ -961,12 +961,12 @@ win_show_status_string(ProfWin *window, const char *const from, } - win_vprint(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s %s", pre, from); + win_printf(window, '-', 0, NULL, NO_EOL, presence_colour, "", "%s %s", pre, from); if (show) - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", show); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", show); else - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", default_show); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", default_show); if (last_activity) { gchar *date_fmt = NULL; @@ -975,13 +975,13 @@ win_show_status_string(ProfWin *window, const char *const from, prefs_free_string(time_pref); assert(date_fmt != NULL); - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", last activity: %s", date_fmt); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", last activity: %s", date_fmt); g_free(date_fmt); } if (status) - win_vprint(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status); + win_printf(window, '-', 0, NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status); win_print(window, '-', 0, NULL, NO_DATE, presence_colour, "", ""); @@ -1013,7 +1013,7 @@ win_print_incoming_message(ProfWin *window, GDateTime *timestamp, } void -win_vprint(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, +win_printf(ProfWin *window, const char show_char, int pad_indent, GDateTime *timestamp, int flags, theme_item_t theme_item, const char *const from, const char *const message, ...) { va_list arg; diff --git a/src/ui/window_list.c b/src/ui/window_list.c index 057d2033..8a3ad299 100644 --- a/src/ui/window_list.c +++ b/src/ui/window_list.c @@ -280,7 +280,7 @@ wins_private_nick_change(const char *const roomjid, const char *const oldnick, c Jid *newjid = jid_create_from_bare_and_resource(roomjid, newnick); privwin->fulljid = strdup(newjid->fulljid); - win_vprint((ProfWin*)privwin, '!', 0, NULL, 0, THEME_THEM, NULL, "** %s is now known as %s.", oldjid->resourcepart, newjid->resourcepart); + win_printf((ProfWin*)privwin, '!', 0, NULL, 0, THEME_THEM, NULL, "** %s is now known as %s.", oldjid->resourcepart, newjid->resourcepart); autocomplete_remove(wins_ac, oldjid->fulljid); autocomplete_remove(wins_close_ac, oldjid->fulljid); |