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
45ea2f45
Commit
45ea2f45
authored
May 20, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify ignored content types for notifications
parent
4ba1c646
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
messages.py
blink/messages.py
+3
-1
No files found.
blink/messages.py
View file @
45ea2f45
...
@@ -32,6 +32,8 @@ class BlinkMessage(MSRPChatMessage):
...
@@ -32,6 +32,8 @@ class BlinkMessage(MSRPChatMessage):
@
implementer
(
IObserver
)
@
implementer
(
IObserver
)
class
OutgoingMessage
(
object
):
class
OutgoingMessage
(
object
):
__ignored_content_types__
=
{
IsComposingDocument
.
content_type
,
IMDNDocument
.
content_type
}
#Content types to ignore in notifications
def
__init__
(
self
,
account
,
contact
,
content
,
content_type
=
'text/plain'
,
recipients
=
None
,
courtesy_recipients
=
None
,
subject
=
None
,
timestamp
=
None
,
required
=
None
,
additional_headers
=
None
,
id
=
None
):
def
__init__
(
self
,
account
,
contact
,
content
,
content_type
=
'text/plain'
,
recipients
=
None
,
courtesy_recipients
=
None
,
subject
=
None
,
timestamp
=
None
,
required
=
None
,
additional_headers
=
None
,
id
=
None
):
self
.
lookup
=
None
self
.
lookup
=
None
self
.
account
=
account
self
.
account
=
account
...
@@ -130,7 +132,7 @@ class OutgoingMessage(object):
...
@@ -130,7 +132,7 @@ class OutgoingMessage(object):
notification_center
.
post_notification
(
'BlinkMessageDidSucceed'
,
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
()
in
self
.
__ignored_content_types__
:
return
return
notification_center
=
NotificationCenter
()
notification_center
=
NotificationCenter
()
notification_center
.
post_notification
(
'BlinkMessageDidFail'
,
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
))
...
...
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