From 4e47ac8714005433dd08cf77c300449c6982da01 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 12 Dec 2016 11:56:53 +0100 Subject: [PATCH] appshare: make accept dialog optional --- src/core/sipe-appshare.c | 29 +++++++++++++++++------------ src/core/sipe-appshare.h | 3 ++- src/core/sipe-conf.c | 3 ++- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/core/sipe-appshare.c b/src/core/sipe-appshare.c index 8d586380..01277cfa 100644 --- a/src/core/sipe-appshare.c +++ b/src/core/sipe-appshare.c @@ -577,22 +577,27 @@ connect_conference(struct sipe_core_private *sipe_private, void sipe_appshare_connect_conference(struct sipe_core_private *sipe_private, - struct sipe_chat_session *chat_session) + struct sipe_chat_session *chat_session, + gboolean user_must_accept) { - const gchar *from; + if (user_must_accept) { + const gchar *from; + + if (chat_session->title) { + from = chat_session->title; + } else if (chat_session->organizer) { + from = chat_session->organizer; + } else { + from = chat_session->id; + } - if (chat_session->title) { - from = chat_session->title; - } else if (chat_session->organizer) { - from = chat_session->organizer; + ask_accept_applicationsharing(sipe_private, from, + (SipeUserAskCb)connect_conference, + NULL, + chat_session); } else { - from = chat_session->id; + connect_conference(sipe_private, chat_session); } - - ask_accept_applicationsharing(sipe_private, from, - (SipeUserAskCb)connect_conference, - NULL, - chat_session); } /* diff --git a/src/core/sipe-appshare.h b/src/core/sipe-appshare.h index 5170e3f9..5769a654 100644 --- a/src/core/sipe-appshare.h +++ b/src/core/sipe-appshare.h @@ -40,4 +40,5 @@ void process_incoming_invite_appshare(struct sipe_core_private *sipe_private, struct sipmsg *msg); void sipe_appshare_connect_conference(struct sipe_core_private *sipe_private, - struct sipe_chat_session *chat_session); + struct sipe_chat_session *chat_session, + gboolean user_must_accept); diff --git a/src/core/sipe-conf.c b/src/core/sipe-conf.c index 3a037f5d..797448d0 100644 --- a/src/core/sipe-conf.c +++ b/src/core/sipe-conf.c @@ -1414,7 +1414,8 @@ sipe_process_conference(struct sipe_core_private *sipe_private, } #if defined(HAVE_XDATA) && defined(HAVE_GIO) if (presentation_was_added) { - sipe_appshare_connect_conference(sipe_private, session->chat_session); + sipe_appshare_connect_conference(sipe_private, session->chat_session, + TRUE); } #endif // defined(HAVE_XDATA) && defined(HAVE_GIO) #endif // HAVE_VV -- 2.11.4.GIT