1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Renamed win_save_vprint -> win_vprint

This commit is contained in:
James Booth 2015-03-14 14:10:10 +00:00
parent 57c7564445
commit f4441ec64f
5 changed files with 199 additions and 199 deletions

View File

@ -1312,8 +1312,8 @@ cmd_msg(gchar **args, struct cmd_help_t help)
} }
return TRUE; return TRUE;
#else #else
message_send_chat(barejid, msg); char *id = message_send_chat(barejid, msg);
ui_outgoing_chat_msg("me", barejid, msg); ui_outgoing_chat_msg("me", barejid, msg, id);
if (((win_type == WIN_CHAT) || (win_type == WIN_CONSOLE)) && prefs_get_boolean(PREF_CHLOG)) { if (((win_type == WIN_CHAT) || (win_type == WIN_CONSOLE)) && prefs_get_boolean(PREF_CHLOG)) {
const char *jid = jabber_get_fulljid(); const char *jid = jabber_get_fulljid();
@ -1722,7 +1722,7 @@ cmd_status(gchar **args, struct cmd_help_t help)
if (occupant) { if (occupant) {
win_show_occupant(window, occupant); win_show_occupant(window, occupant);
} else { } else {
win_save_vprint(window, '-', NULL, 0, 0, "", "No such participant \"%s\" in room.", usr); win_vprint(window, '-', NULL, 0, 0, "", "No such participant \"%s\" in room.", usr);
} }
} else { } else {
ui_current_print_line("You must specify a nickname."); ui_current_print_line("You must specify a nickname.");
@ -2449,7 +2449,7 @@ cmd_kick(gchar **args, struct cmd_help_t help)
char *reason = args[1]; char *reason = args[1];
iq_room_kick_occupant(mucwin->roomjid, nick, reason); iq_room_kick_occupant(mucwin->roomjid, nick, reason);
} else { } else {
win_save_vprint((ProfWin*) mucwin, '!', NULL, 0, 0, "", "Occupant does not exist: %s", nick); win_vprint((ProfWin*) mucwin, '!', NULL, 0, 0, "", "Occupant does not exist: %s", nick);
} }
} else { } else {
cons_show("Usage: %s", help.usage); cons_show("Usage: %s", help.usage);
@ -2508,8 +2508,8 @@ cmd_subject(gchar **args, struct cmd_help_t help)
if (args[0] == NULL) { if (args[0] == NULL) {
char *subject = muc_subject(mucwin->roomjid); char *subject = muc_subject(mucwin->roomjid);
if (subject) { if (subject) {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: "); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
win_save_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject); win_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject);
} else { } else {
win_save_print(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room has no subject"); win_save_print(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room has no subject");
} }
@ -3105,7 +3105,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
ui_outgoing_chat_msg("me", chatwin->barejid, tiny, id); ui_outgoing_chat_msg("me", chatwin->barejid, tiny, id);
} }
#else #else
message_send_chat(chatwin->barejid, tiny); char *id = message_send_chat(chatwin->barejid, tiny);
if (prefs_get_boolean(PREF_CHLOG)) { if (prefs_get_boolean(PREF_CHLOG)) {
const char *jid = jabber_get_fulljid(); const char *jid = jabber_get_fulljid();
Jid *jidp = jid_create(jid); Jid *jidp = jid_create(jid);
@ -3113,7 +3113,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
jid_destroy(jidp); jid_destroy(jidp);
} }
ui_outgoing_chat_msg("me", chatwin->barejid, tiny); ui_outgoing_chat_msg("me", chatwin->barejid, tiny, id);
#endif #endif
} else if (win_type == WIN_PRIVATE) { } else if (win_type == WIN_PRIVATE) {
ProfPrivateWin *privatewin = wins_get_current_private(); ProfPrivateWin *privatewin = wins_get_current_private();

View File

@ -136,7 +136,7 @@ cons_show_typing(const char * const barejid)
display_usr = barejid; display_usr = barejid;
} }
win_save_vprint(console, '-', NULL, 0, THEME_TYPING, "", "!! %s is typing a message...", display_usr); win_vprint(console, '-', NULL, 0, THEME_TYPING, "", "!! %s is typing a message...", display_usr);
cons_alert(); cons_alert();
} }
@ -149,7 +149,7 @@ cons_show_incoming_message(const char * const short_from, const int win_index)
if (ui_index == 10) { if (ui_index == 10) {
ui_index = 0; ui_index = 0;
} }
win_save_vprint(console, '-', NULL, 0, THEME_INCOMING, "", "<< incoming from %s (%d)", short_from, ui_index); win_vprint(console, '-', NULL, 0, THEME_INCOMING, "", "<< incoming from %s (%d)", short_from, ui_index);
cons_alert(); cons_alert();
} }
@ -167,16 +167,16 @@ cons_about(void)
if (strcmp(PACKAGE_STATUS, "development") == 0) { if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION #ifdef HAVE_GIT_VERSION
win_save_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); win_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else #else
win_save_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %sdev", PACKAGE_VERSION); win_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %sdev", PACKAGE_VERSION);
#endif #endif
} else { } else {
win_save_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %s", PACKAGE_VERSION); win_vprint(console, '-', NULL, 0, 0, "", "Welcome to Profanity, version %s", PACKAGE_VERSION);
} }
} }
win_save_vprint(console, '-', NULL, 0, 0, "", "Copyright (C) 2012 - 2015 James Booth <%s>.", PACKAGE_BUGREPORT); win_vprint(console, '-', NULL, 0, 0, "", "Copyright (C) 2012 - 2015 James Booth <%s>.", PACKAGE_BUGREPORT);
win_save_println(console, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>"); win_save_println(console, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>");
win_save_println(console, ""); win_save_println(console, "");
win_save_println(console, "This is free software; you are free to change and redistribute it."); win_save_println(console, "This is free software; you are free to change and redistribute it.");
@ -205,7 +205,7 @@ cons_check_version(gboolean not_available_msg)
if (relase_valid) { if (relase_valid) {
if (release_is_new(latest_release)) { if (release_is_new(latest_release)) {
win_save_vprint(console, '-', NULL, 0, 0, "", "A new version of Profanity is available: %s", latest_release); win_vprint(console, '-', NULL, 0, 0, "", "A new version of Profanity is available: %s", latest_release);
win_save_println(console, "Check <http://www.profanity.im> for details."); win_save_println(console, "Check <http://www.profanity.im> for details.");
win_save_println(console, ""); win_save_println(console, "");
} else { } else {
@ -225,14 +225,14 @@ void
cons_show_login_success(ProfAccount *account) cons_show_login_success(ProfAccount *account)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "%s logged in successfully, ", account->jid); win_vprint(console, '-', NULL, NO_EOL, 0, "", "%s logged in successfully, ", account->jid);
resource_presence_t presence = accounts_get_login_presence(account->name); resource_presence_t presence = accounts_get_login_presence(account->name);
const char *presence_str = string_from_resource_presence(presence); const char *presence_str = string_from_resource_presence(presence);
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", presence_str);
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)", win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", " (priority %d)",
accounts_get_priority_for_presence_type(account->name, presence)); accounts_get_priority_for_presence_type(account->name, presence));
win_save_print(console, '-', NULL, NO_DATE, 0, "", "."); win_save_print(console, '-', NULL, NO_DATE, 0, "", ".");
cons_alert(); cons_alert();
@ -294,7 +294,7 @@ cons_show_caps(const char * const fulljid, resource_presence_t presence)
const char *resource_presence = string_from_resource_presence(presence); const char *resource_presence = string_from_resource_presence(presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", fulljid); win_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", fulljid);
win_save_print(console, '-', NULL, NO_DATE, 0, "", ":"); win_save_print(console, '-', NULL, NO_DATE, 0, "", ":");
// show identity // show identity
@ -318,19 +318,19 @@ cons_show_caps(const char * const fulljid, resource_presence_t presence)
win_save_newline(console); win_save_newline(console);
} }
if (caps->software != NULL) { if (caps->software != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "Software: %s", caps->software); win_vprint(console, '-', NULL, NO_EOL, 0, "", "Software: %s", caps->software);
} }
if (caps->software_version != NULL) { if (caps->software_version != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
} }
if ((caps->software != NULL) || (caps->software_version != NULL)) { if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_newline(console); win_save_newline(console);
} }
if (caps->os != NULL) { if (caps->os != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "OS: %s", caps->os); win_vprint(console, '-', NULL, NO_EOL, 0, "", "OS: %s", caps->os);
} }
if (caps->os_version != NULL) { if (caps->os_version != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
} }
if ((caps->os != NULL) || (caps->os_version != NULL)) { if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_newline(console); win_save_newline(console);
@ -340,7 +340,7 @@ cons_show_caps(const char * const fulljid, resource_presence_t presence)
win_save_println(console, "Features:"); win_save_println(console, "Features:");
GSList *feature = caps->features; GSList *feature = caps->features;
while (feature != NULL) { while (feature != NULL) {
win_save_vprint(console, '-', NULL, 0, 0, "", " %s", feature->data); win_vprint(console, '-', NULL, 0, 0, "", " %s", feature->data);
feature = g_slist_next(feature); feature = g_slist_next(feature);
} }
} }
@ -361,7 +361,7 @@ cons_show_software_version(const char * const jid, const char * const presence,
if ((name != NULL) || (version != NULL) || (os != NULL)) { if ((name != NULL) || (version != NULL) || (os != NULL)) {
cons_show(""); cons_show("");
theme_item_t presence_colour = theme_main_presence_attrs(presence); theme_item_t presence_colour = theme_main_presence_attrs(presence);
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", jid); win_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", jid);
win_save_print(console, '-', NULL, NO_DATE, 0, "", ":"); win_save_print(console, '-', NULL, NO_DATE, 0, "", ":");
} }
if (name != NULL) { if (name != NULL) {
@ -426,9 +426,9 @@ cons_show_room_list(GSList *rooms, const char * const conference_node)
cons_show("Chat rooms at %s:", conference_node); cons_show("Chat rooms at %s:", conference_node);
while (rooms != NULL) { while (rooms != NULL) {
DiscoItem *room = rooms->data; DiscoItem *room = rooms->data;
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " %s", room->jid); win_vprint(console, '-', NULL, NO_EOL, 0, "", " %s", room->jid);
if (room->name != NULL) { if (room->name != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", room->name); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", room->name);
} }
win_save_newline(console); win_save_newline(console);
rooms = g_slist_next(rooms); rooms = g_slist_next(rooms);
@ -460,9 +460,9 @@ cons_show_bookmarks(const GList *list)
if (muc_active(item->jid)) { if (muc_active(item->jid)) {
presence_colour = THEME_ONLINE; presence_colour = THEME_ONLINE;
} }
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", " %s", item->jid); win_vprint(console, '-', NULL, NO_EOL, presence_colour, "", " %s", item->jid);
if (item->nick != NULL) { if (item->nick != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "/%s", item->nick);
} }
if (item->autojoin) { if (item->autojoin) {
win_save_print(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)"); win_save_print(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (autojoin)");
@ -474,7 +474,7 @@ cons_show_bookmarks(const GList *list)
ProfWin *roomwin = (ProfWin*)wins_get_muc(item->jid); ProfWin *roomwin = (ProfWin*)wins_get_muc(item->jid);
if (roomwin != NULL) { if (roomwin != NULL) {
int num = wins_get_num(roomwin); int num = wins_get_num(roomwin);
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (%d)", num); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (%d)", num);
} }
} }
win_save_newline(console); win_save_newline(console);
@ -535,11 +535,11 @@ cons_show_disco_items(GSList *items, const char * const jid)
cons_show("Service discovery items for %s:", jid); cons_show("Service discovery items for %s:", jid);
while (items != NULL) { while (items != NULL) {
DiscoItem *item = items->data; DiscoItem *item = items->data;
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " %s", item->jid); win_vprint(console, '-', NULL, NO_EOL, 0, "", " %s", item->jid);
if (item->name != NULL) { if (item->name != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", item->name); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", (%s)", item->name);
} }
win_save_vprint(console, '-', NULL, NO_DATE, 0, "", ""); win_vprint(console, '-', NULL, NO_DATE, 0, "", "");
items = g_slist_next(items); items = g_slist_next(items);
} }
} else { } else {
@ -614,7 +614,7 @@ cons_show_account_list(gchar **accounts)
(g_strcmp0(jabber_get_account_name(), accounts[i]) == 0)) { (g_strcmp0(jabber_get_account_name(), accounts[i]) == 0)) {
resource_presence_t presence = accounts_get_last_presence(accounts[i]); resource_presence_t presence = accounts_get_last_presence(accounts[i]);
theme_item_t presence_colour = theme_main_presence_attrs(string_from_resource_presence(presence)); theme_item_t presence_colour = theme_main_presence_attrs(string_from_resource_presence(presence));
win_save_vprint(console, '-', NULL, 0, presence_colour, "", "%s", accounts[i]); win_vprint(console, '-', NULL, 0, presence_colour, "", "%s", accounts[i]);
} else { } else {
cons_show(accounts[i]); cons_show(accounts[i]);
} }
@ -739,12 +739,12 @@ cons_show_account(ProfAccount *account)
Resource *resource = curr->data; Resource *resource = curr->data;
const char *resource_presence = string_from_resource_presence(resource->presence); const char *resource_presence = string_from_resource_presence(resource->presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); win_vprint(console, '-', NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence);
if (resource->status != NULL) { if (resource->status != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status);
} }
win_save_vprint(console, '-', NULL, NO_DATE, 0, "", ""); win_vprint(console, '-', NULL, NO_DATE, 0, "", "");
Jid *jidp = jid_create_from_bare_and_resource(account->jid, resource->name); Jid *jidp = jid_create_from_bare_and_resource(account->jid, resource->name);
Capabilities *caps = caps_lookup(jidp->fulljid); Capabilities *caps = caps_lookup(jidp->fulljid);
jid_destroy(jidp); jid_destroy(jidp);
@ -771,19 +771,19 @@ cons_show_account(ProfAccount *account)
win_save_newline(console); win_save_newline(console);
} }
if (caps->software != NULL) { if (caps->software != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software); win_vprint(console, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software);
} }
if (caps->software_version != NULL) { if (caps->software_version != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
} }
if ((caps->software != NULL) || (caps->software_version != NULL)) { if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_newline(console); win_save_newline(console);
} }
if (caps->os != NULL) { if (caps->os != NULL) {
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os); win_vprint(console, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os);
} }
if (caps->os_version != NULL) { if (caps->os_version != NULL) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
} }
if ((caps->os != NULL) || (caps->os_version != NULL)) { if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_newline(console); win_save_newline(console);
@ -1587,12 +1587,12 @@ _cons_splash_logo(void)
if (strcmp(PACKAGE_STATUS, "development") == 0) { if (strcmp(PACKAGE_STATUS, "development") == 0) {
#ifdef HAVE_GIT_VERSION #ifdef HAVE_GIT_VERSION
win_save_vprint(console, '-', NULL, 0, 0, "", "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION); win_vprint(console, '-', NULL, 0, 0, "", "Version %sdev.%s.%s", PACKAGE_VERSION, PROF_GIT_BRANCH, PROF_GIT_REVISION);
#else #else
win_save_vprint(console, '-', NULL, 0, 0, "", "Version %sdev", PACKAGE_VERSION); win_vprint(console, '-', NULL, 0, 0, "", "Version %sdev", PACKAGE_VERSION);
#endif #endif
} else { } else {
win_save_vprint(console, '-', NULL, 0, 0, "", "Version %s", PACKAGE_VERSION); win_vprint(console, '-', NULL, 0, 0, "", "Version %s", PACKAGE_VERSION);
} }
} }
@ -1619,7 +1619,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
} else { } else {
presence_colour = theme_main_presence_attrs("offline"); presence_colour = theme_main_presence_attrs("offline");
} }
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", title->str); win_vprint(console, '-', NULL, NO_EOL, presence_colour, "", title->str);
g_string_free(title, TRUE); g_string_free(title, TRUE);
@ -1639,9 +1639,9 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
} }
if (show_groups) { if (show_groups) {
win_save_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", sub->str); win_vprint(console, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", sub->str);
} else { } else {
win_save_vprint(console, '-', NULL, NO_DATE, presence_colour, "", "%s", sub->str); win_vprint(console, '-', NULL, NO_DATE, presence_colour, "", "%s", sub->str);
} }
g_string_free(sub, TRUE); g_string_free(sub, TRUE);
@ -1657,7 +1657,7 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
} }
groups = g_slist_next(groups); groups = g_slist_next(groups);
} }
win_save_vprint(console, '-', NULL, NO_DATE, 0, "", "%s", groups_str->str); win_vprint(console, '-', NULL, NO_DATE, 0, "", "%s", groups_str->str);
g_string_free(groups_str, TRUE); g_string_free(groups_str, TRUE);
} else { } else {
win_save_print(console, '-', NULL, NO_DATE, 0, "", " "); win_save_print(console, '-', NULL, NO_DATE, 0, "", " ");

View File

@ -662,7 +662,7 @@ ui_handle_recipient_not_found(const char * const recipient, const char * const e
ProfMucWin *mucwin = wins_get_muc(recipient); ProfMucWin *mucwin = wins_get_muc(recipient);
if (mucwin) { if (mucwin) {
cons_show_error("Room %s not found: %s", recipient, err_msg); cons_show_error("Room %s not found: %s", recipient, err_msg);
win_save_vprint((ProfWin*) mucwin, '!', NULL, 0, THEME_ERROR, "", "Room %s not found: %s", recipient, err_msg); win_vprint((ProfWin*) mucwin, '!', NULL, 0, THEME_ERROR, "", "Room %s not found: %s", recipient, err_msg);
return; return;
} }
} }
@ -675,19 +675,19 @@ ui_handle_recipient_error(const char * const recipient, const char * const err_m
ProfChatWin *chatwin = wins_get_chat(recipient); ProfChatWin *chatwin = wins_get_chat(recipient);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); win_vprint((ProfWin*)chatwin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
return; return;
} }
ProfMucWin *mucwin = wins_get_muc(recipient); ProfMucWin *mucwin = wins_get_muc(recipient);
if (mucwin) { if (mucwin) {
win_save_vprint((ProfWin*)mucwin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); win_vprint((ProfWin*)mucwin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
return; return;
} }
ProfPrivateWin *privatewin = wins_get_private(recipient); ProfPrivateWin *privatewin = wins_get_private(recipient);
if (privatewin) { if (privatewin) {
win_save_vprint((ProfWin*)privatewin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg); win_vprint((ProfWin*)privatewin, '!', NULL, 0, THEME_ERROR, "", "Error from %s: %s", recipient, err_msg);
return; return;
} }
} }
@ -1033,7 +1033,7 @@ ui_smp_recipient_initiated(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s wants to authenticate your identity, use '/otr secret <secret>'.", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s wants to authenticate your identity, use '/otr secret <secret>'.", barejid);
} }
} }
@ -1042,8 +1042,8 @@ ui_smp_recipient_initiated_q(const char * const barejid, const char *question)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s wants to authenticate your identity with the following question:", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s wants to authenticate your identity with the following question:", barejid);
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", " %s", question); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", " %s", question);
win_save_print((ProfWin*)chatwin, '!', NULL, 0, 0, "", "use '/otr answer <answer>'."); win_save_print((ProfWin*)chatwin, '!', NULL, 0, 0, "", "use '/otr answer <answer>'.");
} }
} }
@ -1053,7 +1053,7 @@ ui_smp_unsuccessful_sender(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authentication failed, the secret you entered does not match the secret entered by %s.", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authentication failed, the secret you entered does not match the secret entered by %s.", barejid);
} }
} }
@ -1062,7 +1062,7 @@ ui_smp_unsuccessful_receiver(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authentication failed, the secret entered by %s does not match yours.", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authentication failed, the secret entered by %s does not match yours.", barejid);
} }
} }
@ -1089,7 +1089,7 @@ ui_smp_answer_success(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s successfully authenticated you.", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s successfully authenticated you.", barejid);
} }
} }
@ -1098,7 +1098,7 @@ ui_smp_answer_failure(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s failed to authenticate you.", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "%s failed to authenticate you.", barejid);
} }
} }
@ -1107,7 +1107,7 @@ ui_otr_authenticating(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authenticating %s...", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Authenticating %s...", barejid);
} }
} }
@ -1116,7 +1116,7 @@ ui_otr_authetication_waiting(const char * const barejid)
{ {
ProfChatWin *chatwin = wins_get_chat(barejid); ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) { if (chatwin) {
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Awaiting authentication from %s...", barejid); win_vprint((ProfWin*)chatwin, '!', NULL, 0, 0, "", "Awaiting authentication from %s...", barejid);
} }
} }
@ -1318,7 +1318,7 @@ ui_print_system_msg_from_recipient(const char * const barejid, const char *messa
} }
} }
win_save_vprint(window, '-', NULL, 0, 0, "", "*%s %s", barejid, message); win_vprint(window, '-', NULL, 0, 0, "", "*%s %s", barejid, message);
} }
void void
@ -1350,7 +1350,7 @@ ui_recipient_gone(const char * const barejid, const char * const resource)
display_usr = barejid; display_usr = barejid;
} }
win_save_vprint((ProfWin*)chatwin, '!', NULL, 0, THEME_GONE, "", "<- %s has left the conversation.", display_usr); win_vprint((ProfWin*)chatwin, '!', NULL, 0, THEME_GONE, "", "<- %s has left the conversation.", display_usr);
} }
} }
} }
@ -1506,15 +1506,15 @@ ui_room_join(const char * const roomjid, gboolean focus)
} }
char *nick = muc_nick(roomjid); char *nick = muc_nick(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "-> You have joined the room as %s", nick); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "-> You have joined the room as %s", nick);
if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
char *role = muc_role_str(roomjid); char *role = muc_role_str(roomjid);
char *affiliation = muc_affiliation_str(roomjid); char *affiliation = muc_affiliation_str(roomjid);
if (role) { if (role) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", role: %s", role); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", role: %s", role);
} }
if (affiliation) { if (affiliation) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", affiliation: %s", affiliation);
} }
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
@ -1527,7 +1527,7 @@ ui_room_join(const char * const roomjid, gboolean focus)
status_bar_active(num); status_bar_active(num);
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
char *nick = muc_nick(roomjid); char *nick = muc_nick(roomjid);
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "-> Autojoined %s as %s (%d).", roomjid, nick, num); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "-> Autojoined %s as %s (%d).", roomjid, nick, num);
} }
} }
@ -1545,12 +1545,12 @@ ui_room_role_change(const char * const roomjid, const char * const role, const c
const char * const reason) const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your role has been changed to: %s", role); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your role has been changed to: %s", role);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1560,12 +1560,12 @@ ui_room_affiliation_change(const char * const roomjid, const char * const affili
const char * const reason) const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your affiliation has been changed to: %s", affiliation); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your affiliation has been changed to: %s", affiliation);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1575,12 +1575,12 @@ ui_room_role_and_affiliation_change(const char * const roomjid, const char * con
const char * const actor, const char * const reason) const char * const actor, const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your role and affiliation have been changed, role: %s, affiliation: %s", role, affiliation); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Your role and affiliation have been changed, role: %s, affiliation: %s", role, affiliation);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1591,12 +1591,12 @@ ui_room_occupant_role_change(const char * const roomjid, const char * const nick
const char * const actor, const char * const reason) const char * const actor, const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role has been changed to: %s", nick, role); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role has been changed to: %s", nick, role);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1606,12 +1606,12 @@ ui_room_occupant_affiliation_change(const char * const roomjid, const char * con
const char * const actor, const char * const reason) const char * const actor, const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's affiliation has been changed to: %s", nick, affiliation); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's affiliation has been changed to: %s", nick, affiliation);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1621,12 +1621,12 @@ ui_room_occupant_role_and_affiliation_change(const char * const roomjid, const c
const char * const affiliation, const char * const actor, const char * const reason) const char * const affiliation, const char * const actor, const char * const reason)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role and affiliation have been changed, role: %s, affiliation: %s", nick, role, affiliation); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%s's role and affiliation have been changed, role: %s, affiliation: %s", nick, role, affiliation);
if (actor) { if (actor) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", by: %s", actor);
} }
if (reason) { if (reason) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ROOMINFO, "", ", reason: %s", reason);
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
} }
@ -1636,7 +1636,7 @@ ui_handle_room_info_error(const char * const roomjid, const char * const error)
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
win_save_vprint(window, '!', NULL, 0, 0, "", "Room info request failed: %s", error); win_vprint(window, '!', NULL, 0, 0, "", "Room info request failed: %s", error);
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
} }
} }
@ -1674,7 +1674,7 @@ ui_show_room_disco_info(const char * const roomjid, GSList *identities, GSList *
win_save_print(window, '!', NULL, 0, 0, "", "Features:"); win_save_print(window, '!', NULL, 0, 0, "", "Features:");
} }
while (features != NULL) { while (features != NULL) {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", features->data); win_vprint(window, '!', NULL, 0, 0, "", " %s", features->data);
features = g_slist_next(features); features = g_slist_next(features);
} }
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
@ -1693,14 +1693,14 @@ ui_room_roster(const char * const roomjid, GList *roster, const char * const pre
if (presence == NULL) { if (presence == NULL) {
win_save_print(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room is empty."); win_save_print(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room is empty.");
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence); win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "No occupants %s.", presence);
} }
} else { } else {
int length = g_list_length(roster); int length = g_list_length(roster);
if (presence == NULL) { if (presence == NULL) {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%d occupants: ", length); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%d occupants: ", length);
} else { } else {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%d %s: ", length, presence); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "%d %s: ", length, presence);
} }
while (roster != NULL) { while (roster != NULL) {
@ -1708,7 +1708,7 @@ ui_room_roster(const char * const roomjid, GList *roster, const char * const pre
const char *presence_str = string_from_resource_presence(occupant->presence); const char *presence_str = string_from_resource_presence(occupant->presence);
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", "%s", occupant->nick);
if (roster->next != NULL) { if (roster->next != NULL) {
win_save_print(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", "); win_save_print(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", ");
@ -1735,7 +1735,7 @@ ui_room_member_offline(const char * const roomjid, const char * const nick)
if (window == NULL) { if (window == NULL) {
log_error("Received offline presence for room participant %s, but no window open for %s.", nick, roomjid); log_error("Received offline presence for room participant %s, but no window open for %s.", nick, roomjid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s has left the room.", nick); win_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s has left the room.", nick);
} }
} }
@ -1758,7 +1758,7 @@ ui_room_member_kicked(const char * const roomjid, const char * const nick, const
g_string_append(message, reason); g_string_append(message, reason);
} }
win_save_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); win_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s", message->str);
g_string_free(message, TRUE); g_string_free(message, TRUE);
} }
} }
@ -1782,7 +1782,7 @@ ui_room_member_banned(const char * const roomjid, const char * const nick, const
g_string_append(message, reason); g_string_append(message, reason);
} }
win_save_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s", message->str); win_vprint(window, '!', NULL, 0, THEME_OFFLINE, "", "<- %s", message->str);
g_string_free(message, TRUE); g_string_free(message, TRUE);
} }
} }
@ -1795,13 +1795,13 @@ ui_room_member_online(const char * const roomjid, const char * const nick, const
if (window == NULL) { if (window == NULL) {
log_error("Received online presence for room participant %s, but no window open for %s.", nick, roomjid); log_error("Received online presence for room participant %s, but no window open for %s.", nick, roomjid);
} else { } else {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ONLINE, "", "-> %s has joined the room", nick); win_vprint(window, '!', NULL, NO_EOL, THEME_ONLINE, "", "-> %s has joined the room", nick);
if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) { if (prefs_get_boolean(PREF_MUC_PRIVILEGES)) {
if (role) { if (role) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", role: %s", role); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", role: %s", role);
} }
if (affiliation) { if (affiliation) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, THEME_ONLINE, "", ", affiliation: %s", affiliation);
} }
} }
win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", ""); win_save_print(window, '!', NULL, NO_DATE, THEME_ROOMINFO, "", "");
@ -1828,7 +1828,7 @@ ui_room_member_nick_change(const char * const roomjid,
if (window == NULL) { if (window == NULL) {
log_error("Received nick change for room participant %s, but no window open for %s.", old_nick, roomjid); log_error("Received nick change for room participant %s, but no window open for %s.", old_nick, roomjid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick); win_vprint(window, '!', NULL, 0, THEME_THEM, "", "** %s is now known as %s", old_nick, nick);
} }
} }
@ -1839,7 +1839,7 @@ ui_room_nick_change(const char * const roomjid, const char * const nick)
if (window == NULL) { if (window == NULL) {
log_error("Received self nick change %s, but no window open for %s.", nick, roomjid); log_error("Received self nick change %s, but no window open for %s.", nick, roomjid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_ME, "", "** You are now known as %s", nick); win_vprint(window, '!', NULL, 0, THEME_ME, "", "** You are now known as %s", nick);
} }
} }
@ -1965,13 +1965,13 @@ ui_room_requires_config(const char * const roomjid)
} }
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "",
"Room locked, requires configuration."); "Room locked, requires configuration.");
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "",
"Use '/room accept' to accept the defaults"); "Use '/room accept' to accept the defaults");
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "",
"Use '/room destroy' to cancel and destroy the room"); "Use '/room destroy' to cancel and destroy the room");
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "",
"Use '/room config' to edit the room configuration"); "Use '/room config' to edit the room configuration");
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
@ -2022,16 +2022,16 @@ ui_room_destroyed(const char * const roomjid, const char * const reason, const c
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
if (reason) { if (reason) {
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s, reason: %s", roomjid, reason); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s, reason: %s", roomjid, reason);
} else { } else {
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s", roomjid); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- Room destroyed: %s", roomjid);
} }
if (new_jid) { if (new_jid) {
if (password) { if (password) {
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "Replacement room: %s, password: %s", new_jid, password); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "Replacement room: %s, password: %s", new_jid, password);
} else { } else {
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "Replacement room: %s", new_jid); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "Replacement room: %s", new_jid);
} }
} }
} }
@ -2059,7 +2059,7 @@ ui_room_kicked(const char * const roomjid, const char * const actor, const char
} }
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- %s", message->str); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- %s", message->str);
g_string_free(message, TRUE); g_string_free(message, TRUE);
} }
} }
@ -2086,7 +2086,7 @@ ui_room_banned(const char * const roomjid, const char * const actor, const char
} }
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
win_save_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- %s", message->str); win_vprint(console, '!', NULL, 0, THEME_TYPING, "", "<- %s", message->str);
g_string_free(message, TRUE); g_string_free(message, TRUE);
} }
} }
@ -2102,17 +2102,17 @@ ui_room_subject(const char * const roomjid, const char * const nick, const char
if (subject) { if (subject) {
if (nick) { if (nick) {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "*%s has set the room subject: ", nick);
win_save_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject); win_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject);
} else { } else {
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: "); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room subject: ");
win_save_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject); win_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", subject);
} }
} else { } else {
if (nick) { if (nick) {
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject: ", nick); win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "*%s has cleared the room subject: ", nick);
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room subject cleared"); win_vprint(window, '!', NULL, 0, THEME_ROOMINFO, "", "Room subject cleared");
} }
} }
@ -2134,7 +2134,7 @@ ui_handle_room_kick_error(const char * const roomjid, const char * const nick, c
if (window == NULL) { if (window == NULL) {
log_error("Kick error received for %s, but no window open for %s.", nick, roomjid); log_error("Kick error received for %s, but no window open for %s.", nick, roomjid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error kicking %s: %s", nick, error); win_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error kicking %s: %s", nick, error);
} }
} }
@ -2147,8 +2147,8 @@ ui_room_broadcast(const char * const roomjid, const char * const message)
} else { } else {
int num = wins_get_num(window); int num = wins_get_num(window);
win_save_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: "); win_vprint(window, '!', NULL, NO_EOL, THEME_ROOMINFO, "", "Room message: ");
win_save_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", message); win_vprint(window, '!', NULL, NO_DATE, 0, "", "%s", message);
// currently in groupchat window // currently in groupchat window
if (wins_is_current(window)) { if (wins_is_current(window)) {
@ -2167,7 +2167,7 @@ ui_handle_room_affiliation_list_error(const char * const roomjid, const char * c
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
win_save_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", affiliation, error); win_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", affiliation, error);
} }
} }
@ -2177,16 +2177,16 @@ ui_handle_room_affiliation_list(const char * const roomjid, const char * const a
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
if (jids) { if (jids) {
win_save_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation); win_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation);
GSList *curr_jid = jids; GSList *curr_jid = jids;
while (curr_jid) { while (curr_jid) {
char *jid = curr_jid->data; char *jid = curr_jid->data;
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", jid); win_vprint(window, '!', NULL, 0, 0, "", " %s", jid);
curr_jid = g_slist_next(curr_jid); curr_jid = g_slist_next(curr_jid);
} }
win_save_print(window, '!', NULL, 0, 0, "", ""); win_save_print(window, '!', NULL, 0, 0, "", "");
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", "No users found with affiliation: %s", affiliation); win_vprint(window, '!', NULL, 0, 0, "", "No users found with affiliation: %s", affiliation);
win_save_print(window, '!', NULL, 0, 0, "", ""); win_save_print(window, '!', NULL, 0, 0, "", "");
} }
} }
@ -2197,7 +2197,7 @@ ui_handle_room_role_list_error(const char * const roomjid, const char * const ro
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
win_save_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", role, error); win_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error retrieving %s list: %s", role, error);
} }
} }
@ -2207,25 +2207,25 @@ ui_handle_room_role_list(const char * const roomjid, const char * const role, GS
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
if (nicks) { if (nicks) {
win_save_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role); win_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role);
GSList *curr_nick = nicks; GSList *curr_nick = nicks;
while (curr_nick) { while (curr_nick) {
char *nick = curr_nick->data; char *nick = curr_nick->data;
Occupant *occupant = muc_roster_item(roomjid, nick); Occupant *occupant = muc_roster_item(roomjid, nick);
if (occupant) { if (occupant) {
if (occupant->jid) { if (occupant->jid) {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", nick, occupant->jid); win_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", nick, occupant->jid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", nick); win_vprint(window, '!', NULL, 0, 0, "", " %s", nick);
} }
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", nick); win_vprint(window, '!', NULL, 0, 0, "", " %s", nick);
} }
curr_nick = g_slist_next(curr_nick); curr_nick = g_slist_next(curr_nick);
} }
win_save_print(window, '!', NULL, 0, 0, "", ""); win_save_print(window, '!', NULL, 0, 0, "", "");
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", "No occupants found with role: %s", role); win_vprint(window, '!', NULL, 0, 0, "", "No occupants found with role: %s", role);
win_save_print(window, '!', NULL, 0, 0, "", ""); win_save_print(window, '!', NULL, 0, 0, "", "");
} }
} }
@ -2237,7 +2237,7 @@ ui_handle_room_affiliation_set_error(const char * const roomjid, const char * co
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
win_save_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error); win_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error setting %s affiliation for %s: %s", affiliation, jid, error);
} }
} }
@ -2247,7 +2247,7 @@ ui_handle_room_role_set_error(const char * const roomjid, const char * const nic
{ {
ProfWin *window = (ProfWin*)wins_get_muc(roomjid); ProfWin *window = (ProfWin*)wins_get_muc(roomjid);
if (window) { if (window) {
win_save_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error); win_vprint(window, '!', NULL, 0, THEME_ERROR, "", "Error setting %s role for %s: %s", role, nick, error);
} }
} }
@ -2410,9 +2410,9 @@ ui_show_room_info(ProfMucWin *mucwin)
char *affiliation = muc_affiliation_str(mucwin->roomjid); char *affiliation = muc_affiliation_str(mucwin->roomjid);
ProfWin *window = (ProfWin*) mucwin; ProfWin *window = (ProfWin*) mucwin;
win_save_vprint(window, '!', NULL, 0, 0, "", "Room: %s", mucwin->roomjid); win_vprint(window, '!', NULL, 0, 0, "", "Room: %s", mucwin->roomjid);
win_save_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation); win_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation);
win_save_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role); win_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role);
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
} }
@ -2457,9 +2457,9 @@ ui_show_room_role_list(ProfMucWin *mucwin, muc_role_t role)
Occupant *occupant = curr_occupant->data; Occupant *occupant = curr_occupant->data;
if (occupant->role == role) { if (occupant->role == role) {
if (occupant->jid) { if (occupant->jid) {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); win_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", occupant->nick); win_vprint(window, '!', NULL, 0, 0, "", " %s", occupant->nick);
} }
} }
@ -2517,9 +2517,9 @@ ui_show_room_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
Occupant *occupant = curr_occupant->data; Occupant *occupant = curr_occupant->data;
if (occupant->affiliation == affiliation) { if (occupant->affiliation == affiliation) {
if (occupant->jid) { if (occupant->jid) {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid); win_vprint(window, '!', NULL, 0, 0, "", " %s (%s)", occupant->nick, occupant->jid);
} else { } else {
win_save_vprint(window, '!', NULL, 0, 0, "", " %s", occupant->nick); win_vprint(window, '!', NULL, 0, 0, "", " %s", occupant->nick);
} }
} }
@ -2533,8 +2533,8 @@ ui_show_room_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation)
static void static void
_ui_handle_form_field(ProfWin *window, char *tag, FormField *field) _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
{ {
win_save_vprint(window, '-', NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag); win_vprint(window, '-', NULL, NO_EOL, THEME_AWAY, "", "[%s] ", tag);
win_save_vprint(window, '-', NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label); win_vprint(window, '-', NULL, NO_EOL | NO_DATE, 0, "", "%s", field->label);
if (field->required) { if (field->required) {
win_save_print(window, '-', NULL, NO_DATE | NO_EOL, 0, "", " (required): "); win_save_print(window, '-', NULL, NO_DATE | NO_EOL, 0, "", " (required): ");
} else { } else {
@ -2576,7 +2576,7 @@ _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
char *value = curr_value->data; char *value = curr_value->data;
GString *val_tag = g_string_new(""); GString *val_tag = g_string_new("");
g_string_printf(val_tag, "val%d", index++); g_string_printf(val_tag, "val%d", index++);
win_save_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", val_tag->str, value); win_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", val_tag->str, value);
g_string_free(val_tag, TRUE); g_string_free(val_tag, TRUE);
curr_value = g_slist_next(curr_value); curr_value = g_slist_next(curr_value);
} }
@ -2606,9 +2606,9 @@ _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
while (curr_option != NULL) { while (curr_option != NULL) {
FormOption *option = curr_option->data; FormOption *option = curr_option->data;
if (g_strcmp0(option->value, value) == 0) { if (g_strcmp0(option->value, value) == 0) {
win_save_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); win_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label);
} else { } else {
win_save_vprint(window, '-', NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); win_vprint(window, '-', NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label);
} }
curr_option = g_slist_next(curr_option); curr_option = g_slist_next(curr_option);
} }
@ -2622,9 +2622,9 @@ _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
while (curr_option != NULL) { while (curr_option != NULL) {
FormOption *option = curr_option->data; FormOption *option = curr_option->data;
if (g_slist_find_custom(curr_value, option->value, (GCompareFunc)g_strcmp0) != NULL) { if (g_slist_find_custom(curr_value, option->value, (GCompareFunc)g_strcmp0) != NULL) {
win_save_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label); win_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " [%s] %s", option->value, option->label);
} else { } else {
win_save_vprint(window, '-', NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label); win_vprint(window, '-', NULL, 0, THEME_OFFLINE, "", " [%s] %s", option->value, option->label);
} }
curr_option = g_slist_next(curr_option); curr_option = g_slist_next(curr_option);
} }
@ -2643,7 +2643,7 @@ _ui_handle_form_field(ProfWin *window, char *tag, FormField *field)
win_save_newline(window); win_save_newline(window);
while (curr_value != NULL) { while (curr_value != NULL) {
char *value = curr_value->data; char *value = curr_value->data;
win_save_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " %s", value); win_vprint(window, '-', NULL, 0, THEME_ONLINE, "", " %s", value);
curr_value = g_slist_next(curr_value); curr_value = g_slist_next(curr_value);
} }
break; break;
@ -2669,7 +2669,7 @@ ui_show_form(ProfMucConfWin *confwin)
win_save_print(window, '-', NULL, NO_EOL, 0, "", "Form title: "); win_save_print(window, '-', NULL, NO_EOL, 0, "", "Form title: ");
win_save_print(window, '-', NULL, NO_DATE, 0, "", confwin->form->title); win_save_print(window, '-', NULL, NO_DATE, 0, "", confwin->form->title);
} else { } else {
win_save_vprint(window, '-', NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid); win_vprint(window, '-', NULL, 0, 0, "", "Configuration for room %s.", confwin->roomjid);
} }
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
@ -2795,21 +2795,21 @@ ui_handle_room_config_submit_result_error(const char * const roomjid, const char
if (form_window) { if (form_window) {
if (message) { if (message) {
win_save_vprint(form_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error: %s", message); win_vprint(form_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else { } else {
win_save_print(form_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error"); win_save_print(form_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error");
} }
} else if (muc_window) { } else if (muc_window) {
if (message) { if (message) {
win_save_vprint(muc_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error: %s", message); win_vprint(muc_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error: %s", message);
} else { } else {
win_save_print(muc_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error"); win_save_print(muc_window, '!', NULL, 0, THEME_ERROR, "", "Configuration error");
} }
} else { } else {
if (message) { if (message) {
win_save_vprint(console, '!', NULL, 0, THEME_ERROR, "", "Configuration error for %s: %s", roomjid, message); win_vprint(console, '!', NULL, 0, THEME_ERROR, "", "Configuration error for %s: %s", roomjid, message);
} else { } else {
win_save_vprint(console, '!', NULL, 0, THEME_ERROR, "", "Configuration error for %s", roomjid); win_vprint(console, '!', NULL, 0, THEME_ERROR, "", "Configuration error for %s", roomjid);
} }
} }
} else { } else {
@ -2830,9 +2830,9 @@ ui_show_form_field_help(ProfMucConfWin *confwin, char *tag)
win_save_print(window, '-', NULL, NO_DATE, 0, "", ":"); win_save_print(window, '-', NULL, NO_DATE, 0, "", ":");
} }
if (field->description != NULL) { if (field->description != NULL) {
win_save_vprint(window, '-', NULL, 0, 0, "", " Description : %s", field->description); win_vprint(window, '-', NULL, 0, 0, "", " Description : %s", field->description);
} }
win_save_vprint(window, '-', NULL, 0, 0, "", " Type : %s", field->type); win_vprint(window, '-', NULL, 0, 0, "", " Type : %s", field->type);
int num_values = 0; int num_values = 0;
GSList *curr_option = NULL; GSList *curr_option = NULL;
@ -2841,50 +2841,50 @@ ui_show_form_field_help(ProfMucConfWin *confwin, char *tag)
switch (field->type_t) { switch (field->type_t) {
case FIELD_TEXT_SINGLE: case FIELD_TEXT_SINGLE:
case FIELD_TEXT_PRIVATE: case FIELD_TEXT_PRIVATE:
win_save_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is any text"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is any text");
break; break;
case FIELD_TEXT_MULTI: case FIELD_TEXT_MULTI:
num_values = form_get_value_count(confwin->form, tag); num_values = form_get_value_count(confwin->form, tag);
win_save_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is any text"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is any text");
if (num_values > 0) { if (num_values > 0) {
win_save_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_save_vprint(window, '-', NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values); win_vprint(window, '-', NULL, 0, 0, "", " Where : <value> between 'val1' and 'val%d'", num_values);
} }
break; break;
case FIELD_BOOLEAN: case FIELD_BOOLEAN:
win_save_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is either 'on' or 'off'");
break; break;
case FIELD_LIST_SINGLE: case FIELD_LIST_SINGLE:
win_save_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is one of"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options; curr_option = field->options;
while (curr_option != NULL) { while (curr_option != NULL) {
option = curr_option->data; option = curr_option->data;
win_save_vprint(window, '-', NULL, 0, 0, "", " %s", option->value); win_vprint(window, '-', NULL, 0, 0, "", " %s", option->value);
curr_option = g_slist_next(curr_option); curr_option = g_slist_next(curr_option);
} }
break; break;
case FIELD_LIST_MULTI: case FIELD_LIST_MULTI:
win_save_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_save_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is one of"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is one of");
curr_option = field->options; curr_option = field->options;
while (curr_option != NULL) { while (curr_option != NULL) {
option = curr_option->data; option = curr_option->data;
win_save_vprint(window, '-', NULL, 0, 0, "", " %s", option->value); win_vprint(window, '-', NULL, 0, 0, "", " %s", option->value);
curr_option = g_slist_next(curr_option); curr_option = g_slist_next(curr_option);
} }
break; break;
case FIELD_JID_SINGLE: case FIELD_JID_SINGLE:
win_save_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Set : /%s <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is a valid Jabber ID"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break; break;
case FIELD_JID_MULTI: case FIELD_JID_MULTI:
win_save_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Add : /%s add <value>", tag);
win_save_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag); win_vprint(window, '-', NULL, 0, 0, "", " Remove : /%s remove <value>", tag);
win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is a valid Jabber ID"); win_save_print(window, '-', NULL, 0, 0, "", " Where : <value> is a valid Jabber ID");
break; break;
case FIELD_FIXED: case FIELD_FIXED:
@ -2894,7 +2894,7 @@ ui_show_form_field_help(ProfMucConfWin *confwin, char *tag)
break; break;
} }
} else { } else {
win_save_vprint(window, '-', NULL, 0, 0, "", "No such field %s", tag); win_vprint(window, '-', NULL, 0, 0, "", "No such field %s", tag);
} }
} }

View File

@ -548,10 +548,10 @@ win_show_occupant(ProfWin *window, Occupant *occupant)
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", occupant->nick); win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", occupant->nick);
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str);
if (occupant->status) { if (occupant->status) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status);
} }
win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", ""); win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", "");
@ -574,7 +574,7 @@ win_show_contact(ProfWin *window, PContact contact)
win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", barejid); win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", barejid);
} }
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence);
if (last_activity != NULL) { if (last_activity != NULL) {
GDateTime *now = g_date_time_new_now_local(); GDateTime *now = g_date_time_new_now_local();
@ -587,15 +587,15 @@ win_show_contact(ProfWin *window, PContact contact)
int seconds = span / G_TIME_SPAN_SECOND; int seconds = span / G_TIME_SPAN_SECOND;
if (hours > 0) { if (hours > 0) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds);
} }
else { else {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds);
} }
} }
if (status != NULL) { if (status != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact)); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", p_contact_status(contact));
} }
win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", ""); win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", "");
@ -611,20 +611,20 @@ win_show_occupant_info(ProfWin *window, const char * const room, Occupant *occup
theme_item_t presence_colour = theme_main_presence_attrs(presence_str); theme_item_t presence_colour = theme_main_presence_attrs(presence_str);
win_save_print(window, '!', NULL, NO_EOL, presence_colour, "", occupant->nick); win_save_print(window, '!', NULL, NO_EOL, presence_colour, "", occupant->nick);
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", presence_str);
if (occupant->status) { if (occupant->status) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", occupant->status);
} }
win_save_newline(window); win_save_newline(window);
if (occupant->jid) { if (occupant->jid) {
win_save_vprint(window, '!', NULL, 0, 0, "", " Jid: %s", occupant->jid); win_vprint(window, '!', NULL, 0, 0, "", " Jid: %s", occupant->jid);
} }
win_save_vprint(window, '!', NULL, 0, 0, "", " Affiliation: %s", occupant_affiliation); win_vprint(window, '!', NULL, 0, 0, "", " Affiliation: %s", occupant_affiliation);
win_save_vprint(window, '!', NULL, 0, 0, "", " Role: %s", occupant_role); win_vprint(window, '!', NULL, 0, 0, "", " Role: %s", occupant_role);
Jid *jidp = jid_create_from_bare_and_resource(room, occupant->nick); Jid *jidp = jid_create_from_bare_and_resource(room, occupant->nick);
Capabilities *caps = caps_lookup(jidp->fulljid); Capabilities *caps = caps_lookup(jidp->fulljid);
@ -652,19 +652,19 @@ win_show_occupant_info(ProfWin *window, const char * const room, Occupant *occup
win_save_newline(window); win_save_newline(window);
} }
if (caps->software != NULL) { if (caps->software != NULL) {
win_save_vprint(window, '!', NULL, NO_EOL, 0, "", " Software: %s", caps->software); win_vprint(window, '!', NULL, NO_EOL, 0, "", " Software: %s", caps->software);
} }
if (caps->software_version != NULL) { if (caps->software_version != NULL) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
} }
if ((caps->software != NULL) || (caps->software_version != NULL)) { if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_newline(window); win_save_newline(window);
} }
if (caps->os != NULL) { if (caps->os != NULL) {
win_save_vprint(window, '!', NULL, NO_EOL, 0, "", " OS: %s", caps->os); win_vprint(window, '!', NULL, NO_EOL, 0, "", " OS: %s", caps->os);
} }
if (caps->os_version != NULL) { if (caps->os_version != NULL) {
win_save_vprint(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version); win_vprint(window, '!', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
} }
if ((caps->os != NULL) || (caps->os_version != NULL)) { if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_newline(window); win_save_newline(window);
@ -689,12 +689,12 @@ win_show_info(ProfWin *window, PContact contact)
win_save_print(window, '-', NULL, 0, 0, "", ""); win_save_print(window, '-', NULL, 0, 0, "", "");
win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", barejid); win_save_print(window, '-', NULL, NO_EOL, presence_colour, "", barejid);
if (name != NULL) { if (name != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " (%s)", name);
} }
win_save_print(window, '-', NULL, NO_DATE, 0, "", ":"); win_save_print(window, '-', NULL, NO_DATE, 0, "", ":");
if (sub != NULL) { if (sub != NULL) {
win_save_vprint(window, '-', NULL, 0, 0, "", "Subscription: %s", sub); win_vprint(window, '-', NULL, 0, 0, "", "Subscription: %s", sub);
} }
if (last_activity != NULL) { if (last_activity != NULL) {
@ -708,10 +708,10 @@ win_show_info(ProfWin *window, PContact contact)
int seconds = span / G_TIME_SPAN_SECOND; int seconds = span / G_TIME_SPAN_SECOND;
if (hours > 0) { if (hours > 0) {
win_save_vprint(window, '-', NULL, 0, 0, "", "Last activity: %dh%dm%ds", hours, minutes, seconds); win_vprint(window, '-', NULL, 0, 0, "", "Last activity: %dh%dm%ds", hours, minutes, seconds);
} }
else { else {
win_save_vprint(window, '-', NULL, 0, 0, "", "Last activity: %dm%ds", minutes, seconds); win_vprint(window, '-', NULL, 0, 0, "", "Last activity: %dm%ds", minutes, seconds);
} }
g_date_time_unref(now); g_date_time_unref(now);
@ -738,9 +738,9 @@ win_show_info(ProfWin *window, PContact contact)
Resource *resource = curr->data; Resource *resource = curr->data;
const char *resource_presence = string_from_resource_presence(resource->presence); const char *resource_presence = string_from_resource_presence(resource->presence);
theme_item_t presence_colour = theme_main_presence_attrs(resource_presence); theme_item_t presence_colour = theme_main_presence_attrs(resource_presence);
win_save_vprint(window, '-', NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence); win_vprint(window, '-', NULL, NO_EOL, presence_colour, "", " %s (%d), %s", resource->name, resource->priority, resource_presence);
if (resource->status != NULL) { if (resource->status != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", resource->status);
} }
win_save_newline(window); win_save_newline(window);
@ -770,19 +770,19 @@ win_show_info(ProfWin *window, PContact contact)
win_save_newline(window); win_save_newline(window);
} }
if (caps->software != NULL) { if (caps->software != NULL) {
win_save_vprint(window, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software); win_vprint(window, '-', NULL, NO_EOL, 0, "", " Software: %s", caps->software);
} }
if (caps->software_version != NULL) { if (caps->software_version != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->software_version);
} }
if ((caps->software != NULL) || (caps->software_version != NULL)) { if ((caps->software != NULL) || (caps->software_version != NULL)) {
win_save_newline(window); win_save_newline(window);
} }
if (caps->os != NULL) { if (caps->os != NULL) {
win_save_vprint(window, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os); win_vprint(window, '-', NULL, NO_EOL, 0, "", " OS: %s", caps->os);
} }
if (caps->os_version != NULL) { if (caps->os_version != NULL) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, 0, "", ", %s", caps->os_version);
} }
if ((caps->os != NULL) || (caps->os_version != NULL)) { if ((caps->os != NULL) || (caps->os_version != NULL)) {
win_save_newline(window); win_save_newline(window);
@ -812,12 +812,12 @@ win_show_status_string(ProfWin *window, const char * const from,
} }
win_save_vprint(window, '-', NULL, NO_EOL, presence_colour, "", "%s %s", pre, from); win_vprint(window, '-', NULL, NO_EOL, presence_colour, "", "%s %s", pre, from);
if (show != NULL) if (show != NULL)
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", show); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", show);
else else
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", default_show); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", " is %s", default_show);
if (last_activity != NULL) { if (last_activity != NULL) {
GDateTime *now = g_date_time_new_now_local(); GDateTime *now = g_date_time_new_now_local();
@ -831,15 +831,15 @@ win_show_status_string(ProfWin *window, const char * const from,
int seconds = span / G_TIME_SPAN_SECOND; int seconds = span / G_TIME_SPAN_SECOND;
if (hours > 0) { if (hours > 0) {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dh%dm%ds", hours, minutes, seconds);
} }
else { else {
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", idle %dm%ds", minutes, seconds);
} }
} }
if (status != NULL) if (status != NULL)
win_save_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status); win_vprint(window, '-', NULL, NO_DATE | NO_EOL, presence_colour, "", ", \"%s\"", status);
win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", ""); win_save_print(window, '-', NULL, NO_DATE, presence_colour, "", "");
@ -862,7 +862,7 @@ win_print_incoming_message(ProfWin *window, GTimeVal *tv_stamp,
} }
void void
win_save_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp, win_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp,
int flags, theme_item_t theme_item, const char * const from, const char * const message, ...) int flags, theme_item_t theme_item, const char * const from, const char * const message, ...)
{ {
va_list arg; va_list arg;

View File

@ -168,7 +168,7 @@ void win_print_incoming_message(ProfWin *window, GTimeVal *tv_stamp,
const char * const from, const char * const message); const char * const from, const char * const message);
void win_show_info(ProfWin *window, PContact contact); void win_show_info(ProfWin *window, PContact contact);
void win_show_occupant_info(ProfWin *window, const char * const room, Occupant *occupant); void win_show_occupant_info(ProfWin *window, const char * const room, Occupant *occupant);
void win_save_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char * const from, const char * const message, ...); void win_vprint(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char * const from, const char * const message, ...);
void win_save_print(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char * const from, const char * const message); void win_save_print(ProfWin *window, const char show_char, GTimeVal *tstamp, int flags, theme_item_t theme_item, const char * const from, const char * const message);
void win_save_println(ProfWin *window, const char * const message); void win_save_println(ProfWin *window, const char * const message);
void win_save_newline(ProfWin *window); void win_save_newline(ProfWin *window);