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
39928f09
Commit
39928f09
authored
May 05, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed events
parent
d462d04e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
chatwindow.py
blink/chatwindow.py
+7
-8
messages.py
blink/messages.py
+4
-4
No files found.
blink/chatwindow.py
View file @
39928f09
...
@@ -1560,10 +1560,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -1560,10 +1560,10 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamDidFail'
)
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamDidFail'
)
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamDidEnd'
)
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamDidEnd'
)
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamWillEnd'
)
notification_center
.
add_observer
(
self
,
name
=
'MediaStreamWillEnd'
)
notification_center
.
add_observer
(
self
,
name
=
'GotMessage'
)
notification_center
.
add_observer
(
self
,
name
=
'
Blink
GotMessage'
)
notification_center
.
add_observer
(
self
,
name
=
'GotComposingIndication'
)
notification_center
.
add_observer
(
self
,
name
=
'
Blink
GotComposingIndication'
)
notification_center
.
add_observer
(
self
,
name
=
'
DidAcceptMessage
'
)
notification_center
.
add_observer
(
self
,
name
=
'
BlinkMessageDidSucceed
'
)
notification_center
.
add_observer
(
self
,
name
=
'
DidNotDeliverMessage
'
)
notification_center
.
add_observer
(
self
,
name
=
'
BlinkMessageDidFail
'
)
# self.splitter.splitterMoved.connect(self._SH_SplitterMoved) # check this and decide on what size to have in the window (see Notes) -Dan
# self.splitter.splitterMoved.connect(self._SH_SplitterMoved) # check this and decide on what size to have in the window (see Notes) -Dan
...
@@ -2272,7 +2272,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -2272,7 +2272,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
def
_NH_ChatSessionItemDidChange
(
self
,
notification
):
def
_NH_ChatSessionItemDidChange
(
self
,
notification
):
self
.
_update_widgets_for_session
()
self
.
_update_widgets_for_session
()
def
_NH_GotMessage
(
self
,
notification
):
def
_NH_
Blink
GotMessage
(
self
,
notification
):
blink_session
=
notification
.
sender
blink_session
=
notification
.
sender
session
=
blink_session
.
items
.
chat
session
=
blink_session
.
items
.
chat
...
@@ -2316,15 +2316,14 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -2316,15 +2316,14 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
return
return
session
.
update_composing_indication
(
notification
.
data
)
session
.
update_composing_indication
(
notification
.
data
)
def
_NH_
DidAcceptMessage
(
self
,
notification
):
def
_NH_
BlinkMessageDidSucceed
(
self
,
notification
):
blink_session
=
notification
.
sender
blink_session
=
notification
.
sender
session
=
blink_session
.
items
.
chat
session
=
blink_session
.
items
.
chat
if
session
is
None
:
if
session
is
None
:
return
return
session
.
chat_widget
.
update_message_status
(
id
=
notification
.
data
.
id
,
status
=
'accepted'
)
session
.
chat_widget
.
update_message_status
(
id
=
notification
.
data
.
id
,
status
=
'accepted'
)
def
_NH_BlinkMessageDidFail
(
self
,
notification
):
def
_NH_DidNotDeliverMessage
(
self
,
notification
):
blink_session
=
notification
.
sender
blink_session
=
notification
.
sender
session
=
blink_session
.
items
.
chat
session
=
blink_session
.
items
.
chat
if
session
is
None
:
if
session
is
None
:
...
...
blink/messages.py
View file @
39928f09
...
@@ -118,13 +118,13 @@ class OutgoingMessage(object):
...
@@ -118,13 +118,13 @@ class OutgoingMessage(object):
def
_NH_SIPMessageDidSucceed
(
self
,
notification
):
def
_NH_SIPMessageDidSucceed
(
self
,
notification
):
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
notification_center
.
post_notification
(
'
DidAcceptMessage
'
,
sender
=
self
.
session
,
data
=
NotificationData
(
data
=
notification
.
data
,
id
=
self
.
id
))
notification_center
.
post_notification
(
'
BlinkMessageDidSucceed
'
,
sender
=
self
.
session
,
data
=
NotificationData
(
data
=
notification
.
data
,
id
=
self
.
id
))
def
_NH_SIPMessageDidFail
(
self
,
notification
):
def
_NH_SIPMessageDidFail
(
self
,
notification
):
if
self
.
content_type
.
lower
()
==
IsComposingDocument
.
content_type
:
if
self
.
content_type
.
lower
()
==
IsComposingDocument
.
content_type
:
return
return
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
notification_center
.
post_notification
(
'
DidNotDeliverMessage
'
,
sender
=
self
.
session
,
data
=
NotificationData
(
data
=
notification
.
data
,
id
=
self
.
id
))
notification_center
.
post_notification
(
'
BlinkMessageDidFail
'
,
sender
=
self
.
session
,
data
=
NotificationData
(
data
=
notification
.
data
,
id
=
self
.
id
))
@
implementer
(
IObserver
)
@
implementer
(
IObserver
)
...
@@ -199,13 +199,13 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -199,13 +199,13 @@ class MessageManager(object, metaclass=Singleton):
content_type
=
document
.
content_type
.
value
if
document
.
content_type
is
not
None
else
None
,
content_type
=
document
.
content_type
.
value
if
document
.
content_type
is
not
None
else
None
,
last_active
=
document
.
last_active
.
value
if
document
.
last_active
is
not
None
else
None
,
last_active
=
document
.
last_active
.
value
if
document
.
last_active
is
not
None
else
None
,
sender
=
sender
)
sender
=
sender
)
notification_center
.
post_notification
(
'GotComposingIndication'
,
sender
=
blink_session
,
data
=
data
)
notification_center
.
post_notification
(
'
Blink
GotComposingIndication'
,
sender
=
blink_session
,
data
=
data
)
return
return
timestamp
=
str
(
cpim_message
.
timestamp
)
if
cpim_message
is
not
None
and
cpim_message
.
timestamp
is
not
None
else
str
(
ISOTimestamp
.
now
())
timestamp
=
str
(
cpim_message
.
timestamp
)
if
cpim_message
is
not
None
and
cpim_message
.
timestamp
is
not
None
else
str
(
ISOTimestamp
.
now
())
message
=
BlinkMessage
(
body
,
content_type
,
sender
,
timestamp
=
timestamp
,
id
=
message_id
)
message
=
BlinkMessage
(
body
,
content_type
,
sender
,
timestamp
=
timestamp
,
id
=
message_id
)
notification_center
.
post_notification
(
'GotMessage'
,
sender
=
blink_session
,
data
=
message
)
notification_center
.
post_notification
(
'
Blink
GotMessage'
,
sender
=
blink_session
,
data
=
message
)
else
:
else
:
pass
pass
# TODO handle replicated messages
# TODO handle replicated messages
...
...
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