summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-08-05 20:26:57 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-08-05 20:27:05 +0300
commit8280a89ad1c7fc80b8484160c67259e62302e042 (patch)
tree2cd10bf13506d649e7578930b2e0ef3627d435f9 /protocols/JabberG/src
parent339d64cef1ecc064f3d070feedcffc04eef92209 (diff)
Jabber: voip fix
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp4
-rw-r--r--protocols/JabberG/src/jabber_voip.cpp11
2 files changed, 12 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index d1d57b26a9..97a9251693 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -762,6 +762,10 @@ public:
m_proto->m_omemo.init();
else
m_proto->m_omemo.deinit();
+
+ if (!m_proto->m_bEnableVOIP)
+ m_proto->VOIPTerminateSession();
+
m_proto->UpdateFeatHash();
m_proto->SendPresence(m_proto->m_iStatus, true);
return true;
diff --git a/protocols/JabberG/src/jabber_voip.cpp b/protocols/JabberG/src/jabber_voip.cpp
index 5f80c1c364..fec95780de 100644
--- a/protocols/JabberG/src/jabber_voip.cpp
+++ b/protocols/JabberG/src/jabber_voip.cpp
@@ -276,6 +276,9 @@ void dbgprint(const gchar *string)
bool CJabberProto::VOIPCreatePipeline(void)
{
+ if (!m_bEnableVOIP)
+ return false;
+
//gstreamer init
static bool gstinited = 0;
if (!gstinited) {
@@ -347,12 +350,11 @@ err:
bool CJabberProto::VOIPTerminateSession()
{
- gst_print("Terminating session");
if (m_pipe1) {
gst_element_set_state(GST_ELEMENT(m_pipe1), GST_STATE_NULL);
g_clear_object(&m_pipe1);
- gst_print("Pipeline stopped\n");
gst_object_unref(m_pipe1);
+ gst_print("Pipeline stopped\n");
}
m_voipICEPwd.Empty();
@@ -457,12 +459,15 @@ bool CJabberProto::OnICECandidate(const TiXmlElement *Node, const char *)
bool CJabberProto::VOIPCallIinitiate(MCONTACT hContact)
{
- if (m_voipSession != "") {
+ if (!m_voipSession.IsEmpty()) {
VOIPTerminateSession();
MessageBoxA(0, "Terminated", NULL, 0);
return 0;
}
+ if (!m_bEnableVOIP)
+ return false;
+
CMStringA jid(ptrA(getUStringA(hContact, "jid")));
if (jid == "")
return 0;