Philipp Hörist pushed to branch master at gajim / gajim

Commits:
c49f9d60 by Yann Leboulanger at 2018-08-18T14:05:33Z
fix jingle negotiation from an XMPP point of view

- - - - -


4 changed files:

- gajim/chat_control.py
- gajim/common/jingle_rtp.py
- gajim/common/jingle_session.py
- gajim/gui_interface.py


Changes:

=====================================
gajim/chat_control.py
=====================================
--- a/gajim/chat_control.py
+++ b/gajim/chat_control.py
@@ -264,17 +264,17 @@ class ChatControl(ChatControlBase):
             act.connect("activate", func)
             self.parent_win.window.add_action(act)
 
-        act = Gio.SimpleAction.new_stateful(
+        self.audio_action = Gio.SimpleAction.new_stateful(
             'toggle-audio-' + self.control_id, None,
             GLib.Variant.new_boolean(False))
-        act.connect('change-state', self._on_audio)
-        self.parent_win.window.add_action(act)
+        self.audio_action.connect('change-state', self._on_audio)
+        self.parent_win.window.add_action(self.audio_action)
 
-        act = Gio.SimpleAction.new_stateful(
+        self.video_action = Gio.SimpleAction.new_stateful(
             'toggle-video-' + self.control_id,
             None, GLib.Variant.new_boolean(False))
-        act.connect('change-state', self._on_video)
-        self.parent_win.window.add_action(act)
+        self.video_action.connect('change-state', self._on_video)
+        self.parent_win.window.add_action(self.video_action)
 
     def update_actions(self):
         win = self.parent_win.window
@@ -526,7 +526,8 @@ class ChatControl(ChatControlBase):
         if state in ('connection_received', 'connecting'):
             setattr(self, jingle_type + '_sid', sid)
 
-        getattr(self, '_' + jingle_type + '_button').set_active(jingle_state 
!= self.JINGLE_STATE_NULL)
+        v = GLib.Variant.new_boolean(jingle_state != self.JINGLE_STATE_NULL)
+        getattr(self, jingle_type + '_action').change_state(v)
 
         getattr(self, 'update_' + jingle_type)()
 
@@ -724,7 +725,8 @@ class ChatControl(ChatControlBase):
             content = session.get_content(jingle_type)
             if content:
                 session.remove_content(content.creator, content.name)
-        getattr(self, '_' + jingle_type + '_button').set_active(False)
+        v = GLib.Variant.new_boolean(False)
+        getattr(self, jingle_type + '_action').change_state(v)
         getattr(self, 'update_' + jingle_type)()
 
     def on_jingle_button_toggled(self, state, jingle_type):
@@ -768,9 +770,6 @@ class ChatControl(ChatControlBase):
             fixed.set_no_show_all(True)
             self.close_jingle_content(jingle_type)
 
-        img = getattr(self, '_' + jingle_type + 
'_button').get_property('image')
-        img.set_from_file(path_to_img)
-
     def set_lock_image(self):
         loggable = self.session and self.session.is_loggable()
 


=====================================
gajim/common/jingle_rtp.py
=====================================
--- a/gajim/common/jingle_rtp.py
+++ b/gajim/common/jingle_rtp.py
@@ -43,7 +43,7 @@ class JingleRTPContent(JingleContent):
     def __init__(self, session, media, transport=None):
         if transport is None:
             transport = JingleTransportICEUDP(None)
-        JingleContent.__init__(self, session, transport)
+        JingleContent.__init__(self, session, transport, None)
         self.media = media
         self._dtmf_running = False
         self.farstream_media = {


=====================================
gajim/common/jingle_session.py
=====================================
--- a/gajim/common/jingle_session.py
+++ b/gajim/common/jingle_session.py
@@ -633,8 +633,7 @@ class JingleSession:
             if content_type:
                 try:
                     if transport:
-                        content = content_type(
-                            self, transport=transport, senders=senders)
+                        content = content_type(self, transport=transport)
                         self.add_content(element['name'],
                                          content, 'peer')
                         contents.append(content)


=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -1238,7 +1238,7 @@ class Interface:
         # TODO: conditional blocking if peer is not in roster
 
         account = obj.conn.name
-        content_types = obj.contents.media
+        content_types = [obj.contents.media]
 
         # check type of jingle session
         if 'audio' in content_types or 'video' in content_types:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/c49f9d60abbc66ac3d9e3a8a2f18d81cb6af8fad

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/c49f9d60abbc66ac3d9e3a8a2f18d81cb6af8fad
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to