diff options
author | James Booth <boothj5@gmail.com> | 2014-12-28 22:40:59 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-12-28 22:45:25 +0000 |
commit | ac4b59eda08c66d037c794022fff7e3231768c72 (patch) | |
tree | 3a969a04d905cc17ed4937b65452ad85a6661200 /src/chat_session.c | |
parent | 53ecd3b383a01ddb71b6d7fe2320158510582e43 (diff) | |
download | profani-tty-ac4b59eda08c66d037c794022fff7e3231768c72.tar.gz |
Fixed chat state for non OTR
Diffstat (limited to 'src/chat_session.c')
-rw-r--r-- | src/chat_session.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/chat_session.c b/src/chat_session.c index 14436f6c..9e9056a8 100644 --- a/src/chat_session.c +++ b/src/chat_session.c @@ -82,7 +82,7 @@ chat_sessions_clear(void) } void -chat_session_start(const char * const recipient, gboolean recipient_supports) +chat_session_new(const char * const recipient, gboolean recipient_supports) { ChatSession *new_session = malloc(sizeof(struct chat_session_t)); new_session->recipient = strdup(recipient); @@ -260,6 +260,23 @@ chat_session_set_recipient_supports(const char * const recipient, } } +gboolean +chat_session_on_message_send(const char * const barejid) +{ + gboolean send_state = FALSE; + if (prefs_get_boolean(PREF_STATES)) { + if (!chat_session_exists(barejid)) { + chat_session_new(barejid, TRUE); + } + if (chat_session_get_recipient_supports(barejid)) { + chat_session_set_active(barejid); + send_state = TRUE; + } + } + + return send_state; +} + static void _chat_session_free(ChatSession *session) { @@ -271,4 +288,4 @@ _chat_session_free(ChatSession *session) } free(session); } -} +} \ No newline at end of file |