From e602c2909e250e8f1dd9e6420585232113fb9ded Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 27 Dec 2014 00:52:34 +0000 Subject: Moved chat states out of xmpp module for message send chat --- src/otr/otr.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/otr') 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 -- cgit 1.4.1-2-gfad0
about summary refs log blame commit diff stats
path: root/html/022div.cc.html
blob: 76938759c17446e502b180ec786fae291a3b0781 (plain) (tree)
1
2
3
4
5
6
7