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:
parent
3b69ad7b61
commit
aec1484806
@ -77,7 +77,6 @@ prof_run(const int disable_tls, char *log_level, char *account_name)
|
|||||||
_init(disable_tls, log_level);
|
_init(disable_tls, log_level);
|
||||||
|
|
||||||
char inp[INP_WIN_MAX];
|
char inp[INP_WIN_MAX];
|
||||||
int size = 0;
|
|
||||||
|
|
||||||
char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
|
char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
|
||||||
if (account_name != NULL) {
|
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");
|
log_info("Starting main event loop");
|
||||||
|
|
||||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||||
|
int size = 0;
|
||||||
|
gboolean read_input = TRUE;
|
||||||
gboolean cmd_result = 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();
|
conn_status = jabber_get_connection_status();
|
||||||
if (conn_status == JABBER_CONNECTED) {
|
if (conn_status == JABBER_CONNECTED) {
|
||||||
_handle_idle_time();
|
_handle_idle_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
ch = ui_get_char(inp, &size);
|
read_input = ui_get_char(inp, &size);
|
||||||
|
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
otr_poll();
|
otr_poll();
|
||||||
|
@ -174,7 +174,7 @@ ui_close(void)
|
|||||||
endwin();
|
endwin();
|
||||||
}
|
}
|
||||||
|
|
||||||
wint_t
|
gboolean
|
||||||
ui_get_char(char *input, int *size)
|
ui_get_char(char *input, int *size)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
@ -193,7 +193,7 @@ ui_get_char(char *input, int *size)
|
|||||||
ui_input_nonblocking(FALSE);
|
ui_input_nonblocking(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ch;
|
return (ch != '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -229,7 +229,7 @@ void ui_update_presence(const resource_presence_t resource_presence,
|
|||||||
void ui_about(void);
|
void ui_about(void);
|
||||||
void ui_statusbar_new(const int win);
|
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_clear(void);
|
||||||
void ui_input_nonblocking(gboolean);
|
void ui_input_nonblocking(gboolean);
|
||||||
void ui_replace_input(char *input, const char * const new_input, int *size);
|
void ui_replace_input(char *input, const char * const new_input, int *size);
|
||||||
|
@ -323,9 +323,9 @@ void ui_update_presence(const resource_presence_t resource_presence,
|
|||||||
void ui_about(void) {}
|
void ui_about(void) {}
|
||||||
void ui_statusbar_new(const int win) {}
|
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) {}
|
void ui_input_clear(void) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user