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
52e55cfb
Commit
52e55cfb
authored
Aug 26, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle IMDN when there is no session
parent
25437290
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
chatwindow.py
blink/chatwindow.py
+5
-1
messages.py
blink/messages.py
+13
-12
No files found.
blink/chatwindow.py
View file @
52e55cfb
...
...
@@ -2414,7 +2414,11 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
def
_NH_BlinkGotDispositionNotification
(
self
,
notification
):
blink_session
=
notification
.
sender
try
:
session
=
blink_session
.
items
.
chat
except
AttributeError
:
return
if
session
is
None
:
return
data
=
notification
.
data
...
...
blink/messages.py
View file @
52e55cfb
...
...
@@ -744,7 +744,10 @@ class MessageManager(object, metaclass=Singleton):
try
:
blink_session
=
next
(
session
for
session
in
self
.
sessions
if
session
.
contact
.
settings
is
contact
.
settings
)
except
StopIteration
:
blink_session
=
None
if
content_type
.
lower
()
in
self
.
__ignored_content_types__
:
print
(
"Skipping session"
)
if
content_type
.
lower
()
!=
IMDNDocument
.
content_type
:
return
else
:
blink_session
=
session_manager
.
create_session
(
contact
,
contact_uri
,
[
StreamDescription
(
'messages'
)],
account
=
account
,
connect
=
False
)
...
...
@@ -757,6 +760,15 @@ class MessageManager(object, metaclass=Singleton):
blink_session
.
fake_streams
.
get
(
'messages'
)
.
enable_pgp
()
notification_center
.
post_notification
(
'BlinkSessionWillAddStream'
,
sender
=
blink_session
,
data
=
NotificationData
(
stream
=
stream
))
if
account
.
sms
.
use_cpim
and
account
.
sms
.
enable_imdn
and
content_type
.
lower
()
==
IMDNDocument
.
content_type
:
document
=
IMDNDocument
.
parse
(
body
)
imdn_message_id
=
document
.
message_id
.
value
imdn_status
=
document
.
notification
.
status
.
__str__
()
imdn_datetime
=
document
.
datetime
.
__str__
()
notification_center
.
post_notification
(
'BlinkGotDispositionNotification'
,
sender
=
blink_session
,
data
=
NotificationData
(
id
=
imdn_message_id
,
status
=
imdn_status
))
return
elif
content_type
.
lower
()
==
IMDNDocument
.
content_type
:
return
if
content_type
.
lower
()
in
[
'text/pgp-public-key'
,
'text/pgp-private-key'
]:
notification_center
.
post_notification
(
'PGPKeysShouldReload'
,
sender
=
blink_session
)
return
...
...
@@ -776,18 +788,7 @@ class MessageManager(object, metaclass=Singleton):
return
timestamp
=
str
(
cpim_message
.
timestamp
)
if
cpim_message
is
not
None
and
cpim_message
.
timestamp
is
not
None
else
str
(
ISOTimestamp
.
now
())
if
account
.
sms
.
use_cpim
and
account
.
sms
.
enable_imdn
and
content_type
.
lower
()
==
IMDNDocument
.
content_type
:
# print("-- IMDN received")
document
=
IMDNDocument
.
parse
(
body
)
imdn_message_id
=
document
.
message_id
.
value
imdn_status
=
document
.
notification
.
status
.
__str__
()
imdn_datetime
=
document
.
datetime
.
__str__
()
notification_center
.
post_notification
(
'BlinkGotDispositionNotification'
,
sender
=
blink_session
,
data
=
NotificationData
(
id
=
imdn_message_id
,
status
=
imdn_status
))
return
elif
content_type
.
lower
()
==
IMDNDocument
.
content_type
:
return
message
=
BlinkMessage
(
body
,
content_type
,
sender
,
timestamp
=
timestamp
,
id
=
message_id
,
disposition
=
disposition
)
if
encryption
==
'OpenPGP'
:
...
...
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