Only send chat states when preference set

This commit is contained in:
James Booth
2012-10-31 22:08:00 +00:00
parent 7982d7061b
commit 81dd0a1556
3 changed files with 43 additions and 32 deletions

View File

@@ -137,28 +137,31 @@ inp_get_char(int *ch, char *input, int *size)
noecho();
*ch = wgetch(inp_win);
// if not got char, and in chat window, flag as no activity
// send inactive or gone, depending how long inactive
if (*ch == ERR) {
if (win_in_chat()) {
char *recipient = win_get_recipient();
chat_session_no_activity(recipient);
if (prefs_get_states()) {
if (chat_session_gone(recipient) &&
!chat_session_get_sent(recipient)) {
jabber_send_gone(recipient);
} else if (chat_session_inactive(recipient) &&
!chat_session_get_sent(recipient)) {
jabber_send_inactive(recipient);
// if not got char, and in chat window, flag as no activity
// send inactive or gone, depending how long inactive
if (*ch == ERR) {
if (win_in_chat()) {
char *recipient = win_get_recipient();
chat_session_no_activity(recipient);
if (chat_session_gone(recipient) &&
!chat_session_get_sent(recipient)) {
jabber_send_gone(recipient);
} else if (chat_session_inactive(recipient) &&
!chat_session_get_sent(recipient)) {
jabber_send_inactive(recipient);
}
}
}
}
// if got char and in chat window, chat session active
if (*ch != ERR) {
if (win_in_chat()) {
char *recipient = win_get_recipient();
chat_session_set_active(recipient);
// if got char and in chat window, chat session active
if (*ch != ERR) {
if (win_in_chat()) {
char *recipient = win_get_recipient();
chat_session_set_active(recipient);
}
}
}