1
0
Fork 0

Rename win_vprint -> win_printf

This commit is contained in:
James Booth 2016-10-11 23:10:48 +01:00
parent 095c129a6b
commit 0337c5b22c
11 changed files with 214 additions and 214 deletions

View File

@ -1479,7 +1479,7 @@ _cmd_help_cmd_list(const char *const tag)
cons_show("");
ProfWin *console = wins_get_console();
if (tag) {
win_vprint(console, '-', 0, NULL, 0, THEME_WHITE_BOLD, "", "%s commands", 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");
}
@ -3108,7 +3108,7 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
if (occupant) {
win_show_occupant(window, occupant);
} else {
win_vprint(window, '-', 0, NULL, 0, 0, "", "No such participant \"%s\" in room.", usr);
win_printf(window, '-', 0, NULL, 0, 0, "", "No such participant \"%s\" in room.", usr);
}
} else {
ui_current_print_line("You must specify a nickname.");
@ -3881,7 +3881,7 @@ cmd_kick(ProfWin *window, const char *const command, gchar **args)
char *reason = args[1];
iq_room_kick_occupant(mucwin->roomjid, nick, reason);
} else {
win_vprint((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Occupant does not exist: %s", nick);
win_printf((ProfWin*) mucwin, '!', 0, NULL, 0, 0, "", "Occupant does not exist: %s", nick);
}
} else {
cons_bad_cmd_usage(command);
@ -3939,8 +3939,8 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
if (args[0] == NULL) {
char *subject = muc_subject(mucwin->roomjid);
if (subject) {
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 {
win_print(window, '!', 0, NULL, 0, THEME_ROOMINFO, "", "Room has no subject");
}
@ -3974,7 +3974,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
message_send_groupchat_subject(mucwin->roomjid, new_subject->str);
g_string_free(new_subject, TRUE);
} else {
win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
}
} else {
cons_bad_cmd_usage(command);
@ -3991,7 +3991,7 @@ cmd_subject(ProfWin *window, const char *const command, gchar **args)
message_send_groupchat_subject(mucwin->roomjid, new_subject->str);
g_string_free(new_subject, TRUE);
} else {
win_vprint(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
win_printf(window, '!', 0, NULL, NO_EOL, THEME_ROOMINFO, "", "Room does not have a subject, use /subject set <subject>");
}
} else {
cons_bad_cmd_usage(command);
@ -4681,7 +4681,7 @@ cmd_tiny(ProfWin *window, const char *const command, gchar **args)
}
if (!tinyurl_valid(url)) {
win_vprint(window, '-', 0, NULL, 0, THEME_ERROR, "", "/tiny, badly formed URL: %s", url);
win_printf(window, '-', 0, NULL, 0, THEME_ERROR, "", "/tiny, badly formed URL: %s", url);
return TRUE;
}

View File

@ -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

View File

@ -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, "", " ");

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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,