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
06d4f18e
Commit
06d4f18e
authored
Aug 26, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed/changed adding unknown contacts
parent
52e55cfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
messages.py
blink/messages.py
+10
-11
No files found.
blink/messages.py
View file @
06d4f18e
...
@@ -506,11 +506,10 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -506,11 +506,10 @@ class MessageManager(object, metaclass=Singleton):
notification_center
.
add_observer
(
self
,
name
=
'PGPMessageDidNotDecrypt'
)
notification_center
.
add_observer
(
self
,
name
=
'PGPMessageDidNotDecrypt'
)
notification_center
.
add_observer
(
self
,
name
=
'PGPMessageDidDecrypt'
)
notification_center
.
add_observer
(
self
,
name
=
'PGPMessageDidDecrypt'
)
def
_add_contact_to_messages_group
(
self
,
session
):
# Maybe this needs to be placed in Contacts? -- Tijmen
def
_add_contact_to_messages_group
(
self
,
account
,
contact
):
# Maybe this needs to be placed in Contacts? -- Tijmen
if
not
session
.
account
.
sms
.
add_unknown_contacts
:
if
not
account
.
sms
.
add_unknown_contacts
:
return
return
if
contact
.
type
not
in
[
'dummy'
,
'unknown'
]:
if
session
.
contact
.
type
not
in
[
'dummy'
,
'unknown'
]:
return
return
print
(
'Adding contact'
)
print
(
'Adding contact'
)
...
@@ -527,11 +526,11 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -527,11 +526,11 @@ class MessageManager(object, metaclass=Singleton):
group
.
position
=
0
group
.
position
=
0
group
.
expanded
=
True
group
.
expanded
=
True
contact
=
Contact
()
new_
contact
=
Contact
()
contact
.
name
=
session
.
contact
.
name
new_contact
.
name
=
contact
.
name
contact
.
preferred_media
=
session
.
contact
.
preferred_media
new_contact
.
preferred_media
=
contact
.
preferred_media
contact
.
uris
=
[
ContactURI
(
uri
=
uri
.
uri
,
type
=
uri
.
type
)
for
uri
in
session
.
contact
.
uris
]
new_contact
.
uris
=
[
ContactURI
(
uri
=
uri
.
uri
,
type
=
uri
.
type
)
for
uri
in
contact
.
uris
]
contact
.
save
()
new_
contact
.
save
()
group
.
contacts
.
add
(
contact
)
group
.
contacts
.
add
(
contact
)
group
.
save
()
group
.
save
()
...
@@ -797,7 +796,7 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -797,7 +796,7 @@ class MessageManager(object, metaclass=Singleton):
else
:
else
:
self
.
_incoming_encrypted_message_queue
.
append
((
message
,
account
,
contact
))
self
.
_incoming_encrypted_message_queue
.
append
((
message
,
account
,
contact
))
notification_center
.
post_notification
(
'BlinkMessageIsParsed'
,
sender
=
blink_session
,
data
=
message
)
notification_center
.
post_notification
(
'BlinkMessageIsParsed'
,
sender
=
blink_session
,
data
=
message
)
self
.
_add_contact_to_messages_group
(
blink_session
)
self
.
_add_contact_to_messages_group
(
blink_session
.
account
,
blink_session
.
contact
)
notification_center
.
post_notification
(
'BlinkGotMessage'
,
sender
=
blink_session
,
data
=
message
)
notification_center
.
post_notification
(
'BlinkGotMessage'
,
sender
=
blink_session
,
data
=
message
)
return
return
...
@@ -913,7 +912,7 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -913,7 +912,7 @@ class MessageManager(object, metaclass=Singleton):
outgoing_message
=
OutgoingMessage
(
account
,
contact
,
content
,
content_type
,
recipients
,
courtesy_recipients
,
subject
,
timestamp
,
required
,
additional_headers
,
id
,
blink_session
)
outgoing_message
=
OutgoingMessage
(
account
,
contact
,
content
,
content_type
,
recipients
,
courtesy_recipients
,
subject
,
timestamp
,
required
,
additional_headers
,
id
,
blink_session
)
self
.
_send_message
(
outgoing_message
)
self
.
_send_message
(
outgoing_message
)
self
.
_add_contact_to_messages_group
(
blink_session
)
self
.
_add_contact_to_messages_group
(
blink_session
.
account
,
blink_session
.
contact
)
def
create_message_session
(
self
,
uri
):
def
create_message_session
(
self
,
uri
):
from
blink.contacts
import
URIUtils
from
blink.contacts
import
URIUtils
...
...
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