]> sjero.net Git - linphone/commitdiff
add linphonerc setting to disable sending of text chats through existing call dialogs...
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 15 Oct 2012 21:46:42 +0000 (23:46 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 15 Oct 2012 21:47:54 +0000 (23:47 +0200)
coreapi/chat.c

index 941cce423c45c15a2f524fe737612f402345cd61..31f36013523e72a8164d0d53d5f260737e3a05ef 100644 (file)
@@ -22,8 +22,9 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
  
- #include "linphonecore.h"
- #include "private.h"
+#include "linphonecore.h"
+#include "private.h"
+#include "lpconfig.h"
  
  LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to){
        LinphoneAddress *parsed_url=NULL;
@@ -56,15 +57,18 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
        SalOp *op=NULL;
        LinphoneCall *call;
        char* content_type;
-       if((call = linphone_core_get_call_by_remote_address(cr->lc,cr->peer))!=NULL){
-               if (call->state==LinphoneCallConnected ||
-                   call->state==LinphoneCallStreamsRunning ||
-                   call->state==LinphoneCallPaused ||
-                   call->state==LinphoneCallPausing ||
-                   call->state==LinphoneCallPausedByRemote){
-                       ms_message("send SIP message through the existing call.");
-                       op = call->op;
-                       call->pending_message=msg;
+       
+       if (lp_config_get_int(cr->lc->config,"sip","chat_use_call_dialogs",1)){
+               if((call = linphone_core_get_call_by_remote_address(cr->lc,cr->peer))!=NULL){
+                       if (call->state==LinphoneCallConnected ||
+                       call->state==LinphoneCallStreamsRunning ||
+                       call->state==LinphoneCallPaused ||
+                       call->state==LinphoneCallPausing ||
+                       call->state==LinphoneCallPausedByRemote){
+                               ms_message("send SIP message through the existing call.");
+                               op = call->op;
+                               call->pending_message=msg;
+                       }
                }
        }
        if (op==NULL){