Added /otr theirfp with hardcoded fingerprint

This commit is contained in:
James Booth
2014-01-11 19:10:00 +00:00
parent bc8532b79c
commit 03086c0384
7 changed files with 47 additions and 9 deletions

View File

@@ -131,7 +131,7 @@ _cons_show_typing(const char * const barejid)
display_usr = barejid;
}
win_print_line(console, '-', COLOUR_TYPING, "!! %s is typing a message...", display_usr);
win_vprint_line(console, '-', COLOUR_TYPING, "!! %s is typing a message...", display_usr);
wins_refresh_console();
cons_alert();

View File

@@ -746,8 +746,11 @@ _ui_current_print_line(const char * const msg, ...)
ProfWin *current = wins_get_current();
va_list arg;
va_start(arg, msg);
win_print_line(current, '-', 0, msg, arg);
GString *fmt_msg = g_string_new(NULL);
g_string_vprintf(fmt_msg, msg, arg);
win_print_line(current, '-', 0, fmt_msg->str);
va_end(arg);
g_string_free(fmt_msg, TRUE);
win_refresh(current);
}
@@ -775,7 +778,7 @@ _ui_print_error_from_recipient(const char * const from, const char *err_msg)
ProfWin *window = wins_get_by_recipient(from);
if (window != NULL) {
win_print_line(window, '-', COLOUR_ERROR, "%s", err_msg);
win_vprint_line(window, '-', COLOUR_ERROR, "%s", err_msg);
if (wins_is_current(window)) {
wins_refresh_current();
}
@@ -833,7 +836,7 @@ _ui_recipient_gone(const char * const barejid)
ProfWin *window = wins_get_by_recipient(barejid);
if (window != NULL) {
win_print_line(window, '!', COLOUR_GONE, "<- %s has left the conversation.", display_usr);
win_vprint_line(window, '!', COLOUR_GONE, "<- %s has left the conversation.", display_usr);
if (wins_is_current(window)) {
wins_refresh_current();
}
@@ -1329,7 +1332,7 @@ _ui_status_room(const char * const contact)
if (pcontact != NULL) {
win_show_contact(current, pcontact);
} else {
win_print_line(current, '-', 0, "No such participant \"%s\" in room.", contact);
win_vprint_line(current, '-', 0, "No such participant \"%s\" in room.", contact);
}
}

View File

@@ -84,6 +84,16 @@ win_print_time(ProfWin* window, char show_char)
void
win_print_line(ProfWin *window, const char show_char, int attrs,
const char * const msg)
{
win_print_time(window, show_char);
wattron(window->win, attrs);
wprintw(window->win, "%s\n", msg);
wattroff(window->win, attrs);
}
void
win_vprint_line(ProfWin *window, const char show_char, int attrs,
const char * const msg, ...)
{
va_list arg;

View File

@@ -58,8 +58,10 @@ typedef struct prof_win_t {
ProfWin* win_create(const char * const title, int cols, win_type_t type);
void win_free(ProfWin *window);
void win_print_line(ProfWin *self, const char show_char, int attrs,
void win_vprint_line(ProfWin *self, const char show_char, int attrs,
const char * const msg, ...);
void win_print_line(ProfWin *self, const char show_char, int attrs,
const char * const msg);
void win_refresh(ProfWin *window);
void win_page_off(ProfWin *window);
void win_print_time(ProfWin *window, char show_char);