mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 23:36:22 +00:00
Renamed window_show_time -> window_print_time
This commit is contained in:
112
src/ui/console.c
112
src/ui/console.c
@@ -68,7 +68,7 @@ cons_refresh(void)
|
|||||||
void
|
void
|
||||||
cons_show_time(void)
|
cons_show_time(void)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -90,7 +90,7 @@ cons_debug(const char * const msg, ...)
|
|||||||
va_start(arg, msg);
|
va_start(arg, msg);
|
||||||
GString *fmt_msg = g_string_new(NULL);
|
GString *fmt_msg = g_string_new(NULL);
|
||||||
g_string_vprintf(fmt_msg, msg, arg);
|
g_string_vprintf(fmt_msg, msg, arg);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "%s\n", fmt_msg->str);
|
wprintw(console->win, "%s\n", fmt_msg->str);
|
||||||
g_string_free(fmt_msg, TRUE);
|
g_string_free(fmt_msg, TRUE);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
@@ -112,7 +112,7 @@ cons_show(const char * const msg, ...)
|
|||||||
va_start(arg, msg);
|
va_start(arg, msg);
|
||||||
GString *fmt_msg = g_string_new(NULL);
|
GString *fmt_msg = g_string_new(NULL);
|
||||||
g_string_vprintf(fmt_msg, msg, arg);
|
g_string_vprintf(fmt_msg, msg, arg);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "%s\n", fmt_msg->str);
|
wprintw(console->win, "%s\n", fmt_msg->str);
|
||||||
g_string_free(fmt_msg, TRUE);
|
g_string_free(fmt_msg, TRUE);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
@@ -127,7 +127,7 @@ cons_bad_show(const char * const msg, ...)
|
|||||||
va_start(arg, msg);
|
va_start(arg, msg);
|
||||||
GString *fmt_msg = g_string_new(NULL);
|
GString *fmt_msg = g_string_new(NULL);
|
||||||
g_string_vprintf(fmt_msg, msg, arg);
|
g_string_vprintf(fmt_msg, msg, arg);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_ERROR);
|
wattron(console->win, COLOUR_ERROR);
|
||||||
wprintw(console->win, "%s\n", fmt_msg->str);
|
wprintw(console->win, "%s\n", fmt_msg->str);
|
||||||
wattroff(console->win, COLOUR_ERROR);
|
wattroff(console->win, COLOUR_ERROR);
|
||||||
@@ -143,7 +143,7 @@ cons_bad_show(const char * const msg, ...)
|
|||||||
void
|
void
|
||||||
cons_bad_command(const char * const cmd)
|
cons_bad_command(const char * const cmd)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "Unknown command: %s\n", cmd);
|
wprintw(console->win, "Unknown command: %s\n", cmd);
|
||||||
|
|
||||||
dirty = TRUE;
|
dirty = TRUE;
|
||||||
@@ -155,7 +155,7 @@ cons_bad_command(const char * const cmd)
|
|||||||
void
|
void
|
||||||
cons_show_typing(const char * const short_from)
|
cons_show_typing(const char * const short_from)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_TYPING);
|
wattron(console->win, COLOUR_TYPING);
|
||||||
wprintw(console->win, "!! %s is typing a message...\n", short_from);
|
wprintw(console->win, "!! %s is typing a message...\n", short_from);
|
||||||
wattroff(console->win, COLOUR_TYPING);
|
wattroff(console->win, COLOUR_TYPING);
|
||||||
@@ -164,7 +164,7 @@ cons_show_typing(const char * const short_from)
|
|||||||
void
|
void
|
||||||
cons_show_incoming_message(const char * const short_from, const int win_index)
|
cons_show_incoming_message(const char * const short_from, const int win_index)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_INCOMING);
|
wattron(console->win, COLOUR_INCOMING);
|
||||||
wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
|
wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
|
||||||
wattroff(console->win, COLOUR_INCOMING);
|
wattroff(console->win, COLOUR_INCOMING);
|
||||||
@@ -179,7 +179,7 @@ cons_about(void)
|
|||||||
if (prefs_get_boolean(PREF_SPLASH)) {
|
if (prefs_get_boolean(PREF_SPLASH)) {
|
||||||
_cons_splash_logo();
|
_cons_splash_logo();
|
||||||
} else {
|
} else {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
|
|
||||||
if (strcmp(PACKAGE_STATUS, "development") == 0) {
|
if (strcmp(PACKAGE_STATUS, "development") == 0) {
|
||||||
wprintw(console->win, "Welcome to Profanity, version %sdev\n", PACKAGE_VERSION);
|
wprintw(console->win, "Welcome to Profanity, version %sdev\n", PACKAGE_VERSION);
|
||||||
@@ -188,21 +188,21 @@ cons_about(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "Copyright (C) 2012, 2013 James Booth <%s>.\n", PACKAGE_BUGREPORT);
|
wprintw(console->win, "Copyright (C) 2012, 2013 James Booth <%s>.\n", PACKAGE_BUGREPORT);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
|
wprintw(console->win, "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "This is free software; you are free to change and redistribute it.\n");
|
wprintw(console->win, "This is free software; you are free to change and redistribute it.\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "There is NO WARRANTY, to the extent permitted by law.\n");
|
wprintw(console->win, "There is NO WARRANTY, to the extent permitted by law.\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "Type '/help' to show complete help.\n");
|
wprintw(console->win, "Type '/help' to show complete help.\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
|
|
||||||
if (prefs_get_boolean(PREF_VERCHECK)) {
|
if (prefs_get_boolean(PREF_VERCHECK)) {
|
||||||
@@ -227,12 +227,12 @@ 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)) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "A new version of Profanity is available: %s", latest_release);
|
wprintw(console->win, "A new version of Profanity is available: %s", latest_release);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "Check <http://www.profanity.im> for details.\n");
|
wprintw(console->win, "Check <http://www.profanity.im> for details.\n");
|
||||||
free(latest_release);
|
free(latest_release);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
} else {
|
} else {
|
||||||
if (not_available_msg) {
|
if (not_available_msg) {
|
||||||
@@ -252,7 +252,7 @@ cons_check_version(gboolean not_available_msg)
|
|||||||
void
|
void
|
||||||
cons_show_login_success(ProfAccount *account)
|
cons_show_login_success(ProfAccount *account)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "%s logged in successfully, ", account->jid);
|
wprintw(console->win, "%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);
|
||||||
@@ -274,7 +274,7 @@ cons_show_wins(void)
|
|||||||
|
|
||||||
cons_show("");
|
cons_show("");
|
||||||
cons_show("Active windows:");
|
cons_show("Active windows:");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "1: Console\n");
|
wprintw(console->win, "1: Console\n");
|
||||||
|
|
||||||
for (i = 1; i < NUM_WINS; i++) {
|
for (i = 1; i < NUM_WINS; i++) {
|
||||||
@@ -287,7 +287,7 @@ cons_show_wins(void)
|
|||||||
for (i = 1; i < NUM_WINS; i++) {
|
for (i = 1; i < NUM_WINS; i++) {
|
||||||
if (windows[i] != NULL) {
|
if (windows[i] != NULL) {
|
||||||
ProfWin *window = windows[i];
|
ProfWin *window = windows[i];
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
|
|
||||||
switch (window->type)
|
switch (window->type)
|
||||||
{
|
{
|
||||||
@@ -354,9 +354,9 @@ cons_show_info(PContact pcontact)
|
|||||||
GDateTime *last_activity = p_contact_last_activity(pcontact);
|
GDateTime *last_activity = p_contact_last_activity(pcontact);
|
||||||
WINDOW *win = console->win;
|
WINDOW *win = console->win;
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, presence);
|
window_presence_colour_on(console, presence);
|
||||||
wprintw(win, "%s", barejid);
|
wprintw(win, "%s", barejid);
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
@@ -366,7 +366,7 @@ cons_show_info(PContact pcontact)
|
|||||||
wprintw(win, ":\n");
|
wprintw(win, ":\n");
|
||||||
|
|
||||||
if (sub != NULL) {
|
if (sub != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Subscription: %s\n", sub);
|
wprintw(win, "Subscription: %s\n", sub);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ cons_show_info(PContact pcontact)
|
|||||||
GDateTime *now = g_date_time_new_now_local();
|
GDateTime *now = g_date_time_new_now_local();
|
||||||
GTimeSpan span = g_date_time_difference(now, last_activity);
|
GTimeSpan span = g_date_time_difference(now, last_activity);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Last activity: ");
|
wprintw(win, "Last activity: ");
|
||||||
|
|
||||||
int hours = span / G_TIME_SPAN_HOUR;
|
int hours = span / G_TIME_SPAN_HOUR;
|
||||||
@@ -396,7 +396,7 @@ cons_show_info(PContact pcontact)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resources != NULL) {
|
if (resources != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Resources:\n");
|
wprintw(win, "Resources:\n");
|
||||||
|
|
||||||
// sort in order of availabiltiy
|
// sort in order of availabiltiy
|
||||||
@@ -411,7 +411,7 @@ cons_show_info(PContact pcontact)
|
|||||||
while (ordered_resources != NULL) {
|
while (ordered_resources != NULL) {
|
||||||
Resource *resource = ordered_resources->data;
|
Resource *resource = ordered_resources->data;
|
||||||
const char *resource_presence = string_from_resource_presence(resource->presence);
|
const char *resource_presence = string_from_resource_presence(resource->presence);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, resource_presence);
|
window_presence_colour_on(console, resource_presence);
|
||||||
wprintw(win, " %s (%d), %s", resource->name, resource->priority, resource_presence);
|
wprintw(win, " %s (%d), %s", resource->name, resource->priority, resource_presence);
|
||||||
if (resource->status != NULL) {
|
if (resource->status != NULL) {
|
||||||
@@ -425,7 +425,7 @@ cons_show_info(PContact pcontact)
|
|||||||
if (caps != NULL) {
|
if (caps != NULL) {
|
||||||
// show identity
|
// show identity
|
||||||
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " Identity: ");
|
wprintw(win, " Identity: ");
|
||||||
if (caps->name != NULL) {
|
if (caps->name != NULL) {
|
||||||
wprintw(win, "%s", caps->name);
|
wprintw(win, "%s", caps->name);
|
||||||
@@ -445,7 +445,7 @@ cons_show_info(PContact pcontact)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->software != NULL) {
|
if (caps->software != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " Software: %s", caps->software);
|
wprintw(win, " Software: %s", caps->software);
|
||||||
}
|
}
|
||||||
if (caps->software_version != NULL) {
|
if (caps->software_version != NULL) {
|
||||||
@@ -455,7 +455,7 @@ cons_show_info(PContact pcontact)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->os != NULL) {
|
if (caps->os != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " OS: %s", caps->os);
|
wprintw(win, " OS: %s", caps->os);
|
||||||
}
|
}
|
||||||
if (caps->os_version != NULL) {
|
if (caps->os_version != NULL) {
|
||||||
@@ -482,7 +482,7 @@ cons_show_caps(const char * const contact, Resource *resource)
|
|||||||
WINDOW *win = console->win;
|
WINDOW *win = console->win;
|
||||||
cons_show("");
|
cons_show("");
|
||||||
const char *resource_presence = string_from_resource_presence(resource->presence);
|
const char *resource_presence = string_from_resource_presence(resource->presence);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, resource_presence);
|
window_presence_colour_on(console, resource_presence);
|
||||||
wprintw(console->win, "%s", contact);
|
wprintw(console->win, "%s", contact);
|
||||||
window_presence_colour_off(console, resource_presence);
|
window_presence_colour_off(console, resource_presence);
|
||||||
@@ -493,7 +493,7 @@ cons_show_caps(const char * const contact, Resource *resource)
|
|||||||
if (caps != NULL) {
|
if (caps != NULL) {
|
||||||
// show identity
|
// show identity
|
||||||
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Identity: ");
|
wprintw(win, "Identity: ");
|
||||||
if (caps->name != NULL) {
|
if (caps->name != NULL) {
|
||||||
wprintw(win, "%s", caps->name);
|
wprintw(win, "%s", caps->name);
|
||||||
@@ -513,7 +513,7 @@ cons_show_caps(const char * const contact, Resource *resource)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->software != NULL) {
|
if (caps->software != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Software: %s", caps->software);
|
wprintw(win, "Software: %s", caps->software);
|
||||||
}
|
}
|
||||||
if (caps->software_version != NULL) {
|
if (caps->software_version != NULL) {
|
||||||
@@ -523,7 +523,7 @@ cons_show_caps(const char * const contact, Resource *resource)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->os != NULL) {
|
if (caps->os != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "OS: %s", caps->os);
|
wprintw(win, "OS: %s", caps->os);
|
||||||
}
|
}
|
||||||
if (caps->os_version != NULL) {
|
if (caps->os_version != NULL) {
|
||||||
@@ -534,11 +534,11 @@ cons_show_caps(const char * const contact, Resource *resource)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (caps->features != NULL) {
|
if (caps->features != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Features:\n");
|
wprintw(win, "Features:\n");
|
||||||
GSList *feature = caps->features;
|
GSList *feature = caps->features;
|
||||||
while (feature != NULL) {
|
while (feature != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " %s\n", feature->data);
|
wprintw(win, " %s\n", feature->data);
|
||||||
feature = g_slist_next(feature);
|
feature = g_slist_next(feature);
|
||||||
}
|
}
|
||||||
@@ -558,7 +558,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("");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, presence);
|
window_presence_colour_on(console, presence);
|
||||||
wprintw(console->win, "%s", jid);
|
wprintw(console->win, "%s", jid);
|
||||||
window_presence_colour_off(console, presence);
|
window_presence_colour_off(console, presence);
|
||||||
@@ -587,7 +587,7 @@ 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;
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, " %s", room->jid);
|
wprintw(console->win, " %s", room->jid);
|
||||||
if (room->name != NULL) {
|
if (room->name != NULL) {
|
||||||
wprintw(console->win, ", (%s)", room->name);
|
wprintw(console->win, ", (%s)", room->name);
|
||||||
@@ -658,7 +658,7 @@ 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;
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, " %s", item->jid);
|
wprintw(console->win, " %s", item->jid);
|
||||||
if (item->name != NULL) {
|
if (item->name != NULL) {
|
||||||
wprintw(console->win, ", (%s)", item->name);
|
wprintw(console->win, ", (%s)", item->name);
|
||||||
@@ -735,7 +735,7 @@ cons_show_account_list(gchar **accounts)
|
|||||||
if ((jabber_get_connection_status() == JABBER_CONNECTED) &&
|
if ((jabber_get_connection_status() == JABBER_CONNECTED) &&
|
||||||
(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]);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, string_from_resource_presence(presence));
|
window_presence_colour_on(console, string_from_resource_presence(presence));
|
||||||
wprintw(console->win, "%s\n", accounts[i]);
|
wprintw(console->win, "%s\n", accounts[i]);
|
||||||
window_presence_colour_off(console, string_from_resource_presence(presence));
|
window_presence_colour_off(console, string_from_resource_presence(presence));
|
||||||
@@ -789,7 +789,7 @@ cons_show_account(ProfAccount *account)
|
|||||||
|
|
||||||
WINDOW *win = console->win;
|
WINDOW *win = console->win;
|
||||||
if (resources != NULL) {
|
if (resources != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, "Resources:\n");
|
wprintw(win, "Resources:\n");
|
||||||
|
|
||||||
// sort in order of availabiltiy
|
// sort in order of availabiltiy
|
||||||
@@ -804,7 +804,7 @@ cons_show_account(ProfAccount *account)
|
|||||||
while (ordered_resources != NULL) {
|
while (ordered_resources != NULL) {
|
||||||
Resource *resource = ordered_resources->data;
|
Resource *resource = ordered_resources->data;
|
||||||
const char *resource_presence = string_from_resource_presence(resource->presence);
|
const char *resource_presence = string_from_resource_presence(resource->presence);
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
window_presence_colour_on(console, resource_presence);
|
window_presence_colour_on(console, resource_presence);
|
||||||
wprintw(win, " %s (%d), %s", resource->name, resource->priority, resource_presence);
|
wprintw(win, " %s (%d), %s", resource->name, resource->priority, resource_presence);
|
||||||
if (resource->status != NULL) {
|
if (resource->status != NULL) {
|
||||||
@@ -818,7 +818,7 @@ cons_show_account(ProfAccount *account)
|
|||||||
if (caps != NULL) {
|
if (caps != NULL) {
|
||||||
// show identity
|
// show identity
|
||||||
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " Identity: ");
|
wprintw(win, " Identity: ");
|
||||||
if (caps->name != NULL) {
|
if (caps->name != NULL) {
|
||||||
wprintw(win, "%s", caps->name);
|
wprintw(win, "%s", caps->name);
|
||||||
@@ -838,7 +838,7 @@ cons_show_account(ProfAccount *account)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->software != NULL) {
|
if (caps->software != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " Software: %s", caps->software);
|
wprintw(win, " Software: %s", caps->software);
|
||||||
}
|
}
|
||||||
if (caps->software_version != NULL) {
|
if (caps->software_version != NULL) {
|
||||||
@@ -848,7 +848,7 @@ cons_show_account(ProfAccount *account)
|
|||||||
wprintw(win, "\n");
|
wprintw(win, "\n");
|
||||||
}
|
}
|
||||||
if (caps->os != NULL) {
|
if (caps->os != NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(win, " OS: %s", caps->os);
|
wprintw(win, " OS: %s", caps->os);
|
||||||
}
|
}
|
||||||
if (caps->os_version != NULL) {
|
if (caps->os_version != NULL) {
|
||||||
@@ -1234,47 +1234,47 @@ cons_show_contacts(GSList *list)
|
|||||||
static void
|
static void
|
||||||
_cons_splash_logo(void)
|
_cons_splash_logo(void)
|
||||||
{
|
{
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "Welcome to\n");
|
wprintw(console->win, "Welcome to\n");
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, " ___ _ \n");
|
wprintw(console->win, " ___ _ \n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, " / __) (_)_ \n");
|
wprintw(console->win, " / __) (_)_ \n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, " ____ ____ ___ | |__ ____ ____ _| |_ _ _ \n");
|
wprintw(console->win, " ____ ____ ___ | |__ ____ ____ _| |_ _ _ \n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |\n");
|
wprintw(console->win, "| _ \\ / ___) _ \\| __) _ | _ \\| | _) | | |\n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, "| | | | | | |_| | | ( ( | | | | | | |_| |_| |\n");
|
wprintw(console->win, "| | | | | | |_| | | ( ( | | | | | | |_| |_| |\n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |\n");
|
wprintw(console->win, "| ||_/|_| \\___/|_| \\_||_|_| |_|_|\\___)__ |\n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wattron(console->win, COLOUR_SPLASH);
|
wattron(console->win, COLOUR_SPLASH);
|
||||||
wprintw(console->win, "|_| (____/ \n");
|
wprintw(console->win, "|_| (____/ \n");
|
||||||
wattroff(console->win, COLOUR_SPLASH);
|
wattroff(console->win, COLOUR_SPLASH);
|
||||||
|
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
wprintw(console->win, "\n");
|
wprintw(console->win, "\n");
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
if (strcmp(PACKAGE_STATUS, "development") == 0) {
|
if (strcmp(PACKAGE_STATUS, "development") == 0) {
|
||||||
wprintw(console->win, "Version %sdev\n", PACKAGE_VERSION);
|
wprintw(console->win, "Version %sdev\n", PACKAGE_VERSION);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ window_free(ProfWin* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_show_time(ProfWin* window, char show_char)
|
window_print_time(ProfWin* window, char show_char)
|
||||||
{
|
{
|
||||||
GDateTime *time = g_date_time_new_now_local();
|
GDateTime *time = g_date_time_new_now_local();
|
||||||
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
||||||
@@ -122,7 +122,7 @@ window_show_contact(ProfWin *window, PContact contact)
|
|||||||
const char *status = p_contact_status(contact);
|
const char *status = p_contact_status(contact);
|
||||||
GDateTime *last_activity = p_contact_last_activity(contact);
|
GDateTime *last_activity = p_contact_last_activity(contact);
|
||||||
|
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
window_presence_colour_on(window, presence);
|
window_presence_colour_on(window, presence);
|
||||||
wprintw(window->win, "%s", barejid);
|
wprintw(window->win, "%s", barejid);
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ typedef struct prof_win_t {
|
|||||||
ProfWin* window_create(const char * const title, int cols, win_type_t type);
|
ProfWin* window_create(const char * const title, int cols, win_type_t type);
|
||||||
void window_free(ProfWin *window);
|
void window_free(ProfWin *window);
|
||||||
|
|
||||||
void window_show_time(ProfWin *window, char show_char);
|
void window_print_time(ProfWin *window, char show_char);
|
||||||
void window_presence_colour_on(ProfWin *window, const char * const presence);
|
void window_presence_colour_on(ProfWin *window, const char * const presence);
|
||||||
void window_presence_colour_off(ProfWin *window, const char * const presence);
|
void window_presence_colour_off(ProfWin *window, const char * const presence);
|
||||||
void window_show_contact(ProfWin *window, PContact contact);
|
void window_show_contact(ProfWin *window, PContact contact);
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ ui_show_incoming_msg(const char * const from, const char * const message,
|
|||||||
// no spare windows left
|
// no spare windows left
|
||||||
if (win_index == 0) {
|
if (win_index == 0) {
|
||||||
if (tv_stamp == NULL) {
|
if (tv_stamp == NULL) {
|
||||||
window_show_time(console, '-');
|
window_print_time(console, '-');
|
||||||
} else {
|
} else {
|
||||||
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
||||||
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
||||||
@@ -368,7 +368,7 @@ ui_show_incoming_msg(const char * const from, const char * const message,
|
|||||||
// currently viewing chat window with sender
|
// currently viewing chat window with sender
|
||||||
if (win_index == current_index) {
|
if (win_index == current_index) {
|
||||||
if (tv_stamp == NULL) {
|
if (tv_stamp == NULL) {
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
} else {
|
} else {
|
||||||
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
||||||
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
||||||
@@ -407,7 +407,7 @@ ui_show_incoming_msg(const char * const from, const char * const message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tv_stamp == NULL) {
|
if (tv_stamp == NULL) {
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
} else {
|
} else {
|
||||||
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
GDateTime *time = g_date_time_new_from_timeval_utc(tv_stamp);
|
||||||
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
gchar *date_fmt = g_date_time_format(time, "%H:%M:%S");
|
||||||
@@ -501,7 +501,7 @@ ui_disconnected(void)
|
|||||||
for (i = 1; i < NUM_WINS; i++) {
|
for (i = 1; i < NUM_WINS; i++) {
|
||||||
if (windows[i] != NULL) {
|
if (windows[i] != NULL) {
|
||||||
ProfWin *window = windows[i];
|
ProfWin *window = windows[i];
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
wattron(window->win, COLOUR_ERROR);
|
wattron(window->win, COLOUR_ERROR);
|
||||||
wprintw(window->win, "%s\n", "Lost connection.");
|
wprintw(window->win, "%s\n", "Lost connection.");
|
||||||
wattroff(window->win, COLOUR_ERROR);
|
wattroff(window->win, COLOUR_ERROR);
|
||||||
@@ -615,7 +615,7 @@ win_current_show(const char * const msg, ...)
|
|||||||
va_start(arg, msg);
|
va_start(arg, msg);
|
||||||
GString *fmt_msg = g_string_new(NULL);
|
GString *fmt_msg = g_string_new(NULL);
|
||||||
g_string_vprintf(fmt_msg, msg, arg);
|
g_string_vprintf(fmt_msg, msg, arg);
|
||||||
window_show_time(current, '-');
|
window_print_time(current, '-');
|
||||||
wprintw(current->win, "%s\n", fmt_msg->str);
|
wprintw(current->win, "%s\n", fmt_msg->str);
|
||||||
g_string_free(fmt_msg, TRUE);
|
g_string_free(fmt_msg, TRUE);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
@@ -626,7 +626,7 @@ win_current_show(const char * const msg, ...)
|
|||||||
void
|
void
|
||||||
win_current_bad_show(const char * const msg)
|
win_current_bad_show(const char * const msg)
|
||||||
{
|
{
|
||||||
window_show_time(current, '-');
|
window_print_time(current, '-');
|
||||||
wattron(current->win, COLOUR_ERROR);
|
wattron(current->win, COLOUR_ERROR);
|
||||||
wprintw(current->win, "%s\n", msg);
|
wprintw(current->win, "%s\n", msg);
|
||||||
wattroff(current->win, COLOUR_ERROR);
|
wattroff(current->win, COLOUR_ERROR);
|
||||||
@@ -666,7 +666,7 @@ win_show_error_msg(const char * const from, const char *err_msg)
|
|||||||
// chat window exists
|
// chat window exists
|
||||||
if (win_index < NUM_WINS) {
|
if (win_index < NUM_WINS) {
|
||||||
window = windows[win_index];
|
window = windows[win_index];
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
_win_show_error_msg(window->win, err_msg);
|
_win_show_error_msg(window->win, err_msg);
|
||||||
if (win_index == current_index) {
|
if (win_index == current_index) {
|
||||||
dirty = TRUE;
|
dirty = TRUE;
|
||||||
@@ -696,7 +696,7 @@ win_show_system_msg(const char * const from, const char *message)
|
|||||||
}
|
}
|
||||||
window = windows[win_index];
|
window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
wprintw(window->win, "*%s %s\n", bare_jid, message);
|
wprintw(window->win, "*%s %s\n", bare_jid, message);
|
||||||
|
|
||||||
// this is the current window
|
// this is the current window
|
||||||
@@ -718,7 +718,7 @@ win_show_gone(const char * const from)
|
|||||||
// chat window exists
|
// chat window exists
|
||||||
if (win_index < NUM_WINS) {
|
if (win_index < NUM_WINS) {
|
||||||
window = windows[win_index];
|
window = windows[win_index];
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
wattron(window->win, COLOUR_GONE);
|
wattron(window->win, COLOUR_GONE);
|
||||||
wprintw(window->win, "*%s ", from);
|
wprintw(window->win, "*%s ", from);
|
||||||
wprintw(window->win, "has left the conversation.");
|
wprintw(window->win, "has left the conversation.");
|
||||||
@@ -812,7 +812,7 @@ win_show_outgoing_msg(const char * const from, const char * const to,
|
|||||||
window = windows[win_index];
|
window = windows[win_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
if (strncmp(message, "/me ", 4) == 0) {
|
if (strncmp(message, "/me ", 4) == 0) {
|
||||||
wattron(window->win, COLOUR_ME);
|
wattron(window->win, COLOUR_ME);
|
||||||
wprintw(window->win, "*%s ", from);
|
wprintw(window->win, "*%s ", from);
|
||||||
@@ -845,7 +845,7 @@ win_show_room_roster(const char * const room, GList *roster, const char * const
|
|||||||
int win_index = _find_prof_win_index(room);
|
int win_index = _find_prof_win_index(room);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
if ((roster == NULL) || (g_list_length(roster) == 0)) {
|
if ((roster == NULL) || (g_list_length(roster) == 0)) {
|
||||||
wattron(window->win, COLOUR_ROOMINFO);
|
wattron(window->win, COLOUR_ROOMINFO);
|
||||||
if (presence == NULL) {
|
if (presence == NULL) {
|
||||||
@@ -894,7 +894,7 @@ win_show_room_member_offline(const char * const room, const char * const nick)
|
|||||||
int win_index = _find_prof_win_index(room);
|
int win_index = _find_prof_win_index(room);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_OFFLINE);
|
wattron(window->win, COLOUR_OFFLINE);
|
||||||
wprintw(window->win, "<- %s has left the room.\n", nick);
|
wprintw(window->win, "<- %s has left the room.\n", nick);
|
||||||
wattroff(window->win, COLOUR_OFFLINE);
|
wattroff(window->win, COLOUR_OFFLINE);
|
||||||
@@ -910,7 +910,7 @@ win_show_room_member_online(const char * const room, const char * const nick,
|
|||||||
int win_index = _find_prof_win_index(room);
|
int win_index = _find_prof_win_index(room);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_ONLINE);
|
wattron(window->win, COLOUR_ONLINE);
|
||||||
wprintw(window->win, "-> %s has joined the room.\n", nick);
|
wprintw(window->win, "-> %s has joined the room.\n", nick);
|
||||||
wattroff(window->win, COLOUR_ONLINE);
|
wattroff(window->win, COLOUR_ONLINE);
|
||||||
@@ -940,7 +940,7 @@ win_show_room_member_nick_change(const char * const room,
|
|||||||
int win_index = _find_prof_win_index(room);
|
int win_index = _find_prof_win_index(room);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_THEM);
|
wattron(window->win, COLOUR_THEM);
|
||||||
wprintw(window->win, "** %s is now known as %s\n", old_nick, nick);
|
wprintw(window->win, "** %s is now known as %s\n", old_nick, nick);
|
||||||
wattroff(window->win, COLOUR_THEM);
|
wattroff(window->win, COLOUR_THEM);
|
||||||
@@ -955,7 +955,7 @@ win_show_room_nick_change(const char * const room, const char * const nick)
|
|||||||
int win_index = _find_prof_win_index(room);
|
int win_index = _find_prof_win_index(room);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_ME);
|
wattron(window->win, COLOUR_ME);
|
||||||
wprintw(window->win, "** You are now known as %s\n", nick);
|
wprintw(window->win, "** You are now known as %s\n", nick);
|
||||||
wattroff(window->win, COLOUR_ME);
|
wattroff(window->win, COLOUR_ME);
|
||||||
@@ -997,7 +997,7 @@ win_show_room_message(const char * const room_jid, const char * const nick,
|
|||||||
int win_index = _find_prof_win_index(room_jid);
|
int win_index = _find_prof_win_index(room_jid);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) {
|
if (strcmp(nick, muc_get_room_nick(room_jid)) != 0) {
|
||||||
if (strncmp(message, "/me ", 4) == 0) {
|
if (strncmp(message, "/me ", 4) == 0) {
|
||||||
wattron(window->win, COLOUR_THEM);
|
wattron(window->win, COLOUR_THEM);
|
||||||
@@ -1061,7 +1061,7 @@ win_show_room_subject(const char * const room_jid, const char * const subject)
|
|||||||
int win_index = _find_prof_win_index(room_jid);
|
int win_index = _find_prof_win_index(room_jid);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_ROOMINFO);
|
wattron(window->win, COLOUR_ROOMINFO);
|
||||||
wprintw(window->win, "Room subject: ");
|
wprintw(window->win, "Room subject: ");
|
||||||
wattroff(window->win, COLOUR_ROOMINFO);
|
wattroff(window->win, COLOUR_ROOMINFO);
|
||||||
@@ -1084,7 +1084,7 @@ win_show_room_broadcast(const char * const room_jid, const char * const message)
|
|||||||
int win_index = _find_prof_win_index(room_jid);
|
int win_index = _find_prof_win_index(room_jid);
|
||||||
ProfWin *window = windows[win_index];
|
ProfWin *window = windows[win_index];
|
||||||
|
|
||||||
window_show_time(window, '!');
|
window_print_time(window, '!');
|
||||||
wattron(window->win, COLOUR_ROOMINFO);
|
wattron(window->win, COLOUR_ROOMINFO);
|
||||||
wprintw(window->win, "Room message: ");
|
wprintw(window->win, "Room message: ");
|
||||||
wattroff(window->win, COLOUR_ROOMINFO);
|
wattroff(window->win, COLOUR_ROOMINFO);
|
||||||
@@ -1336,7 +1336,7 @@ _show_status_string(ProfWin *window, const char * const from,
|
|||||||
if (!prefs_get_boolean(PREF_STATUSES))
|
if (!prefs_get_boolean(PREF_STATUSES))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
window_show_time(window, '-');
|
window_print_time(window, '-');
|
||||||
|
|
||||||
if (show != NULL) {
|
if (show != NULL) {
|
||||||
if (strcmp(show, "away") == 0) {
|
if (strcmp(show, "away") == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user