diff options
Diffstat (limited to 'src/otr/otr.c')
-rw-r--r-- | src/otr/otr.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c index b6625d1b..3c0fe990 100644 --- a/src/otr/otr.c +++ b/src/otr/otr.c @@ -45,6 +45,7 @@ #include "contact.h" #include "ui/ui.h" #include "config/preferences.h" +#include "chat_session.h" #define PRESENCE_ONLINE 1 #define PRESENCE_OFFLINE 0 @@ -109,7 +110,17 @@ static void cb_inject_message(void *opdata, const char *accountname, const char *protocol, const char *recipient, const char *message) { - message_send_chat(recipient, message); + gboolean send_state = FALSE; + if (prefs_get_boolean(PREF_STATES)) { + if (!chat_session_exists(recipient)) { + chat_session_start(recipient, TRUE); + } + if (chat_session_get_recipient_supports(recipient)) { + chat_session_set_active(recipient); + send_state = TRUE; + } + } + message_send_chat(recipient, NULL, message, send_state); } static void |