Require '/otr start' from both parties before encryption used both ways

This commit is contained in:
James Booth
2014-01-11 17:03:01 +00:00
parent 5c13538e6b
commit 9daefe170d
9 changed files with 114 additions and 18 deletions

View File

@@ -693,6 +693,20 @@ _ui_current_win_type(void)
return current->type;
}
static gboolean
_ui_current_win_is_otr(void)
{
ProfWin *current = wins_get_current();
return current->is_otr;
}
static void
_ui_current_set_otr(gboolean value)
{
ProfWin *current = wins_get_current();
current->is_otr = value;
}
static int
_ui_current_win_index(void)
{
@@ -1609,4 +1623,6 @@ ui_init_module(void)
ui_unread = _ui_unread;
ui_win_unread = _ui_win_unread;
ui_ask_password = _ui_ask_password;
ui_current_win_is_otr = _ui_current_win_is_otr;
ui_current_set_otr = _ui_current_set_otr;
}

View File

@@ -77,6 +77,8 @@ void (*ui_close_current)(void);
void (*ui_clear_current)(void);
win_type_t (*ui_current_win_type)(void);
int (*ui_current_win_index)(void);
gboolean (*ui_current_win_is_otr)(void);
void (*ui_current_set_otr)(gboolean value);
char* (*ui_current_recipient)(void);
void (*ui_current_print_line)(const char * const msg, ...);
void (*ui_current_error_line)(const char * const msg);

View File

@@ -54,6 +54,7 @@ win_create(const char * const title, int cols, win_type_t type)
new_win->unread = 0;
new_win->history_shown = 0;
new_win->type = type;
new_win->is_otr = FALSE;
scrollok(new_win->win, TRUE);
return new_win;

View File

@@ -48,6 +48,7 @@ typedef struct prof_win_t {
char *from;
WINDOW *win;
win_type_t type;
gboolean is_otr;
int y_pos;
int paged;
int unread;