Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
f4ae2397
Commit
f4ae2397
authored
Feb 03, 2016
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved tracking of blink sessions from the session manager
parent
21086ea9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
sessions.py
blink/sessions.py
+16
-16
No files found.
blink/sessions.py
View file @
f4ae2397
...
@@ -5204,16 +5204,10 @@ class SessionManager(object):
...
@@ -5204,16 +5204,10 @@ class SessionManager(object):
notification_center
.
add_observer
(
self
,
name
=
'SIPSessionNewIncoming'
)
notification_center
.
add_observer
(
self
,
name
=
'SIPSessionNewIncoming'
)
notification_center
.
add_observer
(
self
,
name
=
'SIPSessionDidFail'
)
notification_center
.
add_observer
(
self
,
name
=
'SIPSessionDidFail'
)
notification_center
.
add_observer
(
self
,
name
=
'Blink
FileTransferDidChangeState
'
)
notification_center
.
add_observer
(
self
,
name
=
'Blink
SessionWasCreated
'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkFileTransfer
DidEn
d'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkFileTransfer
WasCreate
d'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkFileTransferWillRetry'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkFileTransferWillRetry'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionDidChangeState'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionDidChangeHoldState'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionDidRemoveStream'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionDidEnd'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionWasDeleted'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionListSelectionChanged'
)
notification_center
.
add_observer
(
self
,
name
=
'BlinkSessionListSelectionChanged'
)
def
create_session
(
self
,
contact
,
contact_uri
,
streams
,
account
=
None
,
connect
=
True
,
sibling
=
None
):
def
create_session
(
self
,
contact
,
contact_uri
,
streams
,
account
=
None
,
connect
=
True
,
sibling
=
None
):
...
@@ -5228,7 +5222,6 @@ class SessionManager(object):
...
@@ -5228,7 +5222,6 @@ class SessionManager(object):
reinitialize
=
True
reinitialize
=
True
except
StopIteration
:
except
StopIteration
:
session
=
BlinkSession
()
session
=
BlinkSession
()
self
.
sessions
.
append
(
session
)
reinitialize
=
False
reinitialize
=
False
session
.
init_outgoing
(
account
,
contact
,
contact_uri
,
streams
,
sibling
=
sibling
,
reinitialize
=
reinitialize
)
session
.
init_outgoing
(
account
,
contact
,
contact_uri
,
streams
,
sibling
=
sibling
,
reinitialize
=
reinitialize
)
...
@@ -5248,7 +5241,6 @@ class SessionManager(object):
...
@@ -5248,7 +5241,6 @@ class SessionManager(object):
self
.
send_file_directory
=
os
.
path
.
dirname
(
filename
)
self
.
send_file_directory
=
os
.
path
.
dirname
(
filename
)
transfer
=
BlinkFileTransfer
()
transfer
=
BlinkFileTransfer
()
self
.
file_transfers
.
append
(
transfer
)
transfer
.
init_outgoing
(
account
,
contact
,
contact_uri
,
filename
,
transfer_id
)
transfer
.
init_outgoing
(
account
,
contact
,
contact_uri
,
filename
,
transfer_id
)
transfer
.
connect
()
transfer
.
connect
()
return
transfer
return
transfer
...
@@ -5369,7 +5361,6 @@ class SessionManager(object):
...
@@ -5369,7 +5361,6 @@ class SessionManager(object):
reinitialize
=
True
reinitialize
=
True
except
StopIteration
:
except
StopIteration
:
blink_session
=
BlinkSession
()
blink_session
=
BlinkSession
()
self
.
sessions
.
append
(
blink_session
)
reinitialize
=
False
reinitialize
=
False
blink_session
.
init_incoming
(
incoming_request
.
session
,
accepted_streams
,
incoming_request
.
contact
,
incoming_request
.
contact_uri
,
reinitialize
=
reinitialize
)
blink_session
.
init_incoming
(
incoming_request
.
session
,
accepted_streams
,
incoming_request
.
contact
,
incoming_request
.
contact_uri
,
reinitialize
=
reinitialize
)
...
@@ -5387,7 +5378,6 @@ class SessionManager(object):
...
@@ -5387,7 +5378,6 @@ class SessionManager(object):
self
.
incoming_requests
.
remove
(
incoming_request
)
self
.
incoming_requests
.
remove
(
incoming_request
)
self
.
update_ringtone
()
self
.
update_ringtone
()
transfer
=
BlinkFileTransfer
()
transfer
=
BlinkFileTransfer
()
self
.
file_transfers
.
append
(
transfer
)
transfer
.
init_incoming
(
incoming_request
.
contact
,
incoming_request
.
contact_uri
,
incoming_request
.
session
,
incoming_request
.
stream
)
transfer
.
init_incoming
(
incoming_request
.
contact
,
incoming_request
.
contact_uri
,
incoming_request
.
session
,
incoming_request
.
stream
)
def
_SH_IncomingFileTransferRequestRejected
(
self
,
incoming_request
,
mode
):
def
_SH_IncomingFileTransferRequestRejected
(
self
,
incoming_request
,
mode
):
...
@@ -5441,7 +5431,6 @@ class SessionManager(object):
...
@@ -5441,7 +5431,6 @@ class SessionManager(object):
reinitialize
=
True
reinitialize
=
True
except
StopIteration
:
except
StopIteration
:
blink_session
=
BlinkSession
()
blink_session
=
BlinkSession
()
self
.
sessions
.
append
(
blink_session
)
reinitialize
=
False
reinitialize
=
False
blink_session
.
init_incoming
(
session
,
[
chat_stream
],
contact
,
contact_uri
,
reinitialize
=
reinitialize
)
blink_session
.
init_incoming
(
session
,
[
chat_stream
],
contact
,
contact_uri
,
reinitialize
=
reinitialize
)
return
return
...
@@ -5464,6 +5453,10 @@ class SessionManager(object):
...
@@ -5464,6 +5453,10 @@ class SessionManager(object):
self
.
incoming_requests
.
remove
(
incoming_request
)
self
.
incoming_requests
.
remove
(
incoming_request
)
self
.
update_ringtone
()
self
.
update_ringtone
()
def
_NH_BlinkSessionWasCreated
(
self
,
notification
):
self
.
sessions
.
append
(
notification
.
sender
)
notification
.
center
.
add_observer
(
self
,
sender
=
notification
.
sender
)
def
_NH_BlinkSessionDidChangeState
(
self
,
notification
):
def
_NH_BlinkSessionDidChangeState
(
self
,
notification
):
new_state
=
notification
.
data
.
new_state
new_state
=
notification
.
data
.
new_state
if
new_state
==
'connected/received_proposal'
:
if
new_state
==
'connected/received_proposal'
:
...
@@ -5504,17 +5497,24 @@ class SessionManager(object):
...
@@ -5504,17 +5497,24 @@ class SessionManager(object):
def
_NH_BlinkSessionWasDeleted
(
self
,
notification
):
def
_NH_BlinkSessionWasDeleted
(
self
,
notification
):
self
.
sessions
.
remove
(
notification
.
sender
)
self
.
sessions
.
remove
(
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
def
_NH_BlinkFileTransferWasCreated
(
self
,
notification
):
self
.
file_transfers
.
append
(
notification
.
sender
)
notification
.
center
.
add_observer
(
self
,
sender
=
notification
.
sender
)
def
_NH_BlinkFileTransferWillRetry
(
self
,
notification
):
self
.
file_transfers
.
append
(
notification
.
sender
)
notification
.
center
.
add_observer
(
self
,
sender
=
notification
.
sender
)
def
_NH_BlinkFileTransferDidChangeState
(
self
,
notification
):
def
_NH_BlinkFileTransferDidChangeState
(
self
,
notification
):
new_state
=
notification
.
data
.
new_state
new_state
=
notification
.
data
.
new_state
if
new_state
in
(
'connecting/ringing'
,
'connected'
,
'ending'
):
if
new_state
in
(
'connecting/ringing'
,
'connected'
,
'ending'
):
self
.
update_ringtone
()
self
.
update_ringtone
()
def
_NH_BlinkFileTransferWillRetry
(
self
,
notification
):
self
.
file_transfers
.
append
(
notification
.
sender
)
def
_NH_BlinkFileTransferDidEnd
(
self
,
notification
):
def
_NH_BlinkFileTransferDidEnd
(
self
,
notification
):
self
.
file_transfers
.
remove
(
notification
.
sender
)
self
.
file_transfers
.
remove
(
notification
.
sender
)
notification
.
center
.
remove_observer
(
self
,
sender
=
notification
.
sender
)
if
not
notification
.
data
.
error
and
not
self
.
_filetransfer_tone_timer
.
isActive
():
if
not
notification
.
data
.
error
and
not
self
.
_filetransfer_tone_timer
.
isActive
():
self
.
_filetransfer_tone_timer
.
start
()
self
.
_filetransfer_tone_timer
.
start
()
player
=
WavePlayer
(
SIPApplication
.
voice_audio_bridge
.
mixer
,
Resources
.
get
(
'sounds/file_transfer.wav'
),
volume
=
30
)
player
=
WavePlayer
(
SIPApplication
.
voice_audio_bridge
.
mixer
,
Resources
.
get
(
'sounds/file_transfer.wav'
),
volume
=
30
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment