diff options
| author | James Booth <boothj5@gmail.com> | 2015-01-04 23:40:10 +0000 |
|---|---|---|
| committer | James Booth <boothj5@gmail.com> | 2015-01-04 23:40:10 +0000 |
| commit | 8326c8b3a21fd4a6aa415f92584aebedd51b01d9 (patch) | |
| tree | 74c4477596daed645d9af2bbb3223f9c42ca2aca /src/ui | |
| parent | 42a5c431c777ab22c2187bb6f50a62ef304d8d6b (diff) | |
| download | profani-tty-8326c8b3a21fd4a6aa415f92584aebedd51b01d9.tar.gz | |
Refactored chat session handling on sending message
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/core.c | 8 | ||||
| -rw-r--r-- | src/ui/inputwin.c | 16 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 2e8ae9ff..d5e01d94 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -705,7 +705,9 @@ ui_close_connected_win(int index) otr_end_session(chatwin->barejid); } #endif - chat_session_on_window_close(chatwin->barejid); + if (chat_session_exists(chatwin->barejid)) { + chat_session_on_window_close(chatwin->barejid); + } } } } @@ -1162,7 +1164,9 @@ ui_prune_wins(void) if (window->type == WIN_CHAT) { if (conn_status == JABBER_CONNECTED) { ProfChatWin *chatwin = (ProfChatWin*)window; - chat_session_on_window_close(chatwin->barejid); + if (chat_session_exists(chatwin->barejid)) { + chat_session_on_window_close(chatwin->barejid); + } } } diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 4165bd3f..19318745 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -151,17 +151,11 @@ inp_get_char(char *input, int *size, int *result) in_command = TRUE; } - if (prefs_get_boolean(PREF_STATES)) { - if (*result == ERR) { - prof_handle_idle(); - } - if (prefs_get_boolean(PREF_OUTTYPE) - && (*result != ERR) - && (*result != KEY_CODE_YES) - && !in_command - && _printable(ch)) { - prof_handle_activity(); - } + if (*result == ERR) { + prof_handle_idle(); + } + if ((*result != ERR) && (*result != KEY_CODE_YES) && !in_command && _printable(ch)) { + prof_handle_activity(); } // if it wasn't an arrow key etc |