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
bc4a4d08
Commit
bc4a4d08
authored
Sep 06, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed imdn and propagate account object
parent
8d204ef8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
messages.py
blink/messages.py
+4
-4
message.py
blink/streams/message.py
+3
-4
No files found.
blink/messages.py
View file @
bc4a4d08
...
@@ -1140,11 +1140,11 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -1140,11 +1140,11 @@ class MessageManager(object, metaclass=Singleton):
self
.
_send_message
(
outgoing_message
)
self
.
_send_message
(
outgoing_message
)
def
send_imdn_message
(
self
,
session
,
id
,
timestamp
,
state
,
account
=
None
):
def
send_imdn_message
(
self
,
session
,
id
,
timestamp
,
state
,
account
=
None
):
if
not
session
.
account
.
sms
.
use_cpim
and
not
session
.
account
.
sms
.
enable_imdn
and
account
is
None
:
if
account
is
None
and
not
session
.
account
.
sms
.
use_cpim
or
not
session
.
account
.
sms
.
enable_imdn
:
return
if
account
is
not
None
and
not
account
.
sms
.
use_cpim
and
not
account
.
sms
.
enable_imdn
:
return
return
if
account
is
not
None
:
if
not
account
.
sms
.
use_cpim
or
not
account
.
sms
.
enable_imdn
:
return
log
.
debug
(
f
"-- Attempt to send imdn for {id}: {state}"
)
log
.
debug
(
f
"-- Attempt to send imdn for {id}: {state}"
)
if
state
==
'delivered'
:
if
state
==
'delivered'
:
...
...
blink/streams/message.py
View file @
bc4a4d08
...
@@ -185,7 +185,7 @@ class MessageStream(object, metaclass=MediaStreamType):
...
@@ -185,7 +185,7 @@ class MessageStream(object, metaclass=MediaStreamType):
log
.
warning
(
f
'Decryption failed for {msg_id}, this is not a PGPMessage, error: {e}'
)
log
.
warning
(
f
'Decryption failed for {msg_id}, this is not a PGPMessage, error: {e}'
)
return
return
key_list
=
[(
session
.
account
.
id
,
self
.
private_key
)]
if
self
.
private_key
is
not
None
else
[]
key_list
=
[(
session
.
account
,
self
.
private_key
)]
if
self
.
private_key
is
not
None
else
[]
key_list
.
extend
(
self
.
other_private_keys
)
key_list
.
extend
(
self
.
other_private_keys
)
error
=
None
error
=
None
...
@@ -193,7 +193,7 @@ class MessageStream(object, metaclass=MediaStreamType):
...
@@ -193,7 +193,7 @@ class MessageStream(object, metaclass=MediaStreamType):
try
:
try
:
decrypted_message
=
key
.
decrypt
(
pgpMessage
)
decrypted_message
=
key
.
decrypt
(
pgpMessage
)
except
(
PGPDecryptionError
,
PGPError
)
as
error
:
except
(
PGPDecryptionError
,
PGPError
)
as
error
:
log
.
debug
(
f
'-- Decryption failed for {msg_id} with account key {account}, error: {error}'
)
log
.
debug
(
f
'-- Decryption failed for {msg_id} with account key {account
.id
}, error: {error}'
)
continue
continue
else
:
else
:
message
.
content
=
decrypted_message
.
message
.
decode
()
if
isinstance
(
decrypted_message
.
message
,
bytearray
)
else
decrypted_message
.
message
message
.
content
=
decrypted_message
.
message
.
decode
()
if
isinstance
(
decrypted_message
.
message
,
bytearray
)
else
decrypted_message
.
message
...
@@ -268,5 +268,4 @@ class MessageStream(object, metaclass=MediaStreamType):
...
@@ -268,5 +268,4 @@ class MessageStream(object, metaclass=MediaStreamType):
loaded_key
=
self
.
_load_key
(
str
(
account
.
id
),
public_key
=
False
)
loaded_key
=
self
.
_load_key
(
str
(
account
.
id
),
public_key
=
False
)
if
loaded_key
is
None
:
if
loaded_key
is
None
:
continue
continue
self
.
other_private_keys
.
append
((
account
.
id
,
loaded_key
))
self
.
other_private_keys
.
append
((
account
,
loaded_key
))
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