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

Removed ch from main loop

This commit is contained in:
James Booth 2015-01-15 01:21:24 +00:00
parent 3b69ad7b61
commit aec1484806
4 changed files with 12 additions and 11 deletions

View File

@ -77,7 +77,6 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
_init(disable_tls, log_level);
char inp[INP_WIN_MAX];
int size = 0;
char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
if (account_name != NULL) {
@ -94,18 +93,20 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
log_info("Starting main event loop");
jabber_conn_status_t conn_status = jabber_get_connection_status();
int size = 0;
gboolean read_input = TRUE;
gboolean cmd_result = TRUE;
while(cmd_result == TRUE) {
wint_t ch = ERR;
size = 0;
while(ch != '\n') {
while(cmd_result == TRUE) {
size = 0;
read_input = TRUE;
while(read_input) {
conn_status = jabber_get_connection_status();
if (conn_status == JABBER_CONNECTED) {
_handle_idle_time();
}
ch = ui_get_char(inp, &size);
read_input = ui_get_char(inp, &size);
#ifdef HAVE_LIBOTR
otr_poll();

View File

@ -174,7 +174,7 @@ ui_close(void)
endwin();
}
wint_t
gboolean
ui_get_char(char *input, int *size)
{
int result = 0;
@ -193,7 +193,7 @@ ui_get_char(char *input, int *size)
ui_input_nonblocking(FALSE);
}
return ch;
return (ch != '\n');
}
void

View File

@ -229,7 +229,7 @@ void ui_update_presence(const resource_presence_t resource_presence,
void ui_about(void);
void ui_statusbar_new(const int win);
wint_t ui_get_char(char *input, int *size);
gboolean ui_get_char(char *input, int *size);
void ui_input_clear(void);
void ui_input_nonblocking(gboolean);
void ui_replace_input(char *input, const char * const new_input, int *size);

View File

@ -323,9 +323,9 @@ void ui_update_presence(const resource_presence_t resource_presence,
void ui_about(void) {}
void ui_statusbar_new(const int win) {}
wint_t ui_get_char(char *input, int *size)
gboolean ui_get_char(char *input, int *size)
{
return 0;
return FALSE;
}
void ui_input_clear(void) {}