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
831e5aa5
Commit
831e5aa5
authored
Aug 15, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send public key to session contact on first message
parent
53b7985e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
messages.py
blink/messages.py
+9
-1
No files found.
blink/messages.py
View file @
831e5aa5
...
@@ -326,6 +326,7 @@ class OutgoingMessage(object):
...
@@ -326,6 +326,7 @@ class OutgoingMessage(object):
self
.
timestamp
=
timestamp
if
timestamp
is
not
None
else
ISOTimestamp
.
now
()
self
.
timestamp
=
timestamp
if
timestamp
is
not
None
else
ISOTimestamp
.
now
()
self
.
sip_uri
=
SIPURI
.
parse
(
'sip:
%
s'
%
self
.
uri
)
self
.
sip_uri
=
SIPURI
.
parse
(
'sip:
%
s'
%
self
.
uri
)
self
.
session
=
session
self
.
session
=
session
self
.
contact
=
contact
@
property
@
property
def
message
(
self
):
def
message
(
self
):
...
@@ -381,7 +382,6 @@ class OutgoingMessage(object):
...
@@ -381,7 +382,6 @@ class OutgoingMessage(object):
payload
,
payload
,
credentials
=
self
.
account
.
credentials
,
credentials
=
self
.
account
.
credentials
,
extra_headers
=
additional_sip_headers
)
extra_headers
=
additional_sip_headers
)
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
sender
=
message_request
)
notification_center
.
add_observer
(
self
,
sender
=
message_request
)
message_request
.
send
()
message_request
.
send
()
else
:
else
:
...
@@ -418,6 +418,14 @@ class OutgoingMessage(object):
...
@@ -418,6 +418,14 @@ class OutgoingMessage(object):
self
.
_send
(
routes
)
self
.
_send
(
routes
)
return
return
self
.
session
.
routes
=
routes
self
.
session
.
routes
=
routes
# TODO: Figure out how now to send a public when required, not always on start of the first message in the session
if
self
.
content_type
!=
'text/pgp-public-key'
:
stream
=
self
.
session
.
fake_streams
.
get
(
'messages'
)
if
self
.
account
.
sms
.
enable_pgp
and
stream
.
can_encrypt
:
public_key
=
stream
.
public_key
public_key_message
=
OutgoingMessage
(
self
.
account
,
self
.
contact
,
str
(
public_key
),
'text/pgp-public-key'
,
session
=
self
.
session
)
public_key_message
.
send
()
self
.
_send
()
self
.
_send
()
def
_NH_DNSLookupDidFail
(
self
,
notification
):
def
_NH_DNSLookupDidFail
(
self
,
notification
):
...
...
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