change attributes in jingle Event

This commit is contained in:
Yann Leboulanger 2010-10-27 10:28:59 +02:00
parent ea48697543
commit 6edd6cbfd5
2 changed files with 9 additions and 10 deletions

View File

@ -1119,6 +1119,7 @@ class JingleReceivedEvent(nec.NetworkIncomingEvent):
base_network_events = []
def generate(self):
self.jid = self.jingle_session.peerjid
self.fjid = self.jingle_session.peerjid
self.jid, self.resource = gajim.get_room_and_nick_from_fjid(self.fjid)
self.sid = self.jingle_session.sid
return True

View File

@ -1513,36 +1513,34 @@ class Interface:
# unknown session type... it should be declined in common/jingle.py
return
jid = gajim.get_jid_without_resource(obj.jid)
resource = gajim.get_resource_from_jid(obj.jid)
ctrl = (self.msg_win_mgr.get_control(obj.jid, account)
or self.msg_win_mgr.get_control(jid, account))
ctrl = (self.msg_win_mgr.get_control(obj.fjid, account)
or self.msg_win_mgr.get_control(obj.jid, account))
if ctrl:
if 'audio' in content_types:
ctrl.set_audio_state('connection_received', obj.sid)
if 'video' in content_types:
ctrl.set_video_state('connection_received', obj.sid)
dlg = dialogs.VoIPCallReceivedDialog.get_dialog(obj.jid, obj.sid)
dlg = dialogs.VoIPCallReceivedDialog.get_dialog(obj.fjid, obj.sid)
if dlg:
dlg.add_contents(content_types)
return
if helpers.allow_popup_window(account):
dialogs.VoIPCallReceivedDialog(account, obj.jid, obj.sid,
dialogs.VoIPCallReceivedDialog(account, obj.fjid, obj.sid,
content_types)
return
self.add_event(account, obj.jid, 'jingle-incoming', (obj.jid, obj.sid,
self.add_event(account, obj.jid, 'jingle-incoming', (obj.fjid, obj.sid,
content_types))
if helpers.allow_showing_notification(account):
# TODO: we should use another pixmap ;-)
txt = _('%s wants to start a voice chat.') % \
gajim.get_name_from_jid(account, obj.jid)
gajim.get_name_from_jid(account, obj.fjid)
path = gtkgui_helpers.get_icon_path('gajim-mic_active', 48)
event_type = _('Voice Chat Request')
notify.popup(event_type, obj.jid, account, 'jingle-incoming',
notify.popup(event_type, obj.fjid, account, 'jingle-incoming',
path_to_image=path, title=event_type, text=txt)
def handle_event_jingle_connected(self, account, data):