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
880466ff
Commit
880466ff
authored
Sep 01, 2022
by
Tijmen de Mes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for other account messages in chat session
parent
26246eb3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
chatwindow.py
blink/chatwindow.py
+10
-2
messages.py
blink/messages.py
+4
-4
No files found.
blink/chatwindow.py
View file @
880466ff
...
@@ -2386,6 +2386,11 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -2386,6 +2386,11 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
message
=
notification
.
data
.
message
message
=
notification
.
data
.
message
direction
=
notification
.
data
.
message
.
direction
direction
=
notification
.
data
.
message
.
direction
try
:
received_account
=
notification
.
data
.
account
except
AttributeError
:
received_account
=
None
encrypted
=
False
encrypted
=
False
if
message
.
content_type
.
startswith
(
'image/'
):
if
message
.
content_type
.
startswith
(
'image/'
):
content
=
'''<img src="data:{};base64,{}" class="scaled-to-fit" />'''
.
format
(
message
.
content_type
,
message
.
content
.
decode
(
'base64'
)
.
rstrip
())
content
=
'''<img src="data:{};base64,{}" class="scaled-to-fit" />'''
.
format
(
message
.
content_type
,
message
.
content
.
decode
(
'base64'
)
.
rstrip
())
...
@@ -2425,9 +2430,9 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -2425,9 +2430,9 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
if
direction
!=
'outgoing'
and
message
.
disposition
is
not
None
and
'display'
in
message
.
disposition
and
not
encrypted
:
if
direction
!=
'outgoing'
and
message
.
disposition
is
not
None
and
'display'
in
message
.
disposition
and
not
encrypted
:
if
self
.
selected_session
.
blink_session
is
blink_session
and
not
self
.
isMinimized
()
and
self
.
isActiveWindow
():
if
self
.
selected_session
.
blink_session
is
blink_session
and
not
self
.
isMinimized
()
and
self
.
isActiveWindow
():
MessageManager
()
.
send_imdn_message
(
blink_session
,
message
.
id
,
message
.
timestamp
,
'displayed'
,
account
)
MessageManager
()
.
send_imdn_message
(
blink_session
,
message
.
id
,
message
.
timestamp
,
'displayed'
,
received_
account
)
else
:
else
:
self
.
pending_displayed_notifications
.
setdefault
(
blink_session
,
[])
.
append
((
message
.
id
,
message
.
timestamp
,
account
))
self
.
pending_displayed_notifications
.
setdefault
(
blink_session
,
[])
.
append
((
message
.
id
,
message
.
timestamp
,
received_
account
))
session
.
remote_composing
=
False
session
.
remote_composing
=
False
settings
=
SIPSimpleSettings
()
settings
=
SIPSimpleSettings
()
...
@@ -2572,6 +2577,9 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
...
@@ -2572,6 +2577,9 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
if
message
.
direction
==
"outgoing"
:
if
message
.
direction
==
"outgoing"
:
session
.
chat_widget
.
update_message_status
(
id
=
message
.
message_id
,
status
=
message
.
state
)
session
.
chat_widget
.
update_message_status
(
id
=
message
.
message_id
,
status
=
message
.
state
)
elif
message
.
state
!=
'displayed'
and
'display'
in
message
.
disposition
and
not
encrypted
:
elif
message
.
state
!=
'displayed'
and
'display'
in
message
.
disposition
and
not
encrypted
:
if
account_manager
.
has_account
(
message
.
account_id
):
account
=
account_manager
.
get_account
(
message
.
account_id
)
if
message
.
state
!=
'delivered'
and
'positive-delivery'
in
message
.
disposition
:
if
message
.
state
!=
'delivered'
and
'positive-delivery'
in
message
.
disposition
:
MessageManager
()
.
send_imdn_message
(
blink_session
,
message
.
message_id
,
message
.
timestamp
,
'delivered'
,
account
)
MessageManager
()
.
send_imdn_message
(
blink_session
,
message
.
message_id
,
message
.
timestamp
,
'delivered'
,
account
)
if
self
.
selected_session
.
blink_session
is
blink_session
and
not
self
.
isMinimized
()
and
self
.
isActiveWindow
():
if
self
.
selected_session
.
blink_session
is
blink_session
and
not
self
.
isMinimized
()
and
self
.
isActiveWindow
():
...
...
blink/messages.py
View file @
880466ff
...
@@ -434,13 +434,13 @@ class OutgoingMessage(object):
...
@@ -434,13 +434,13 @@ class OutgoingMessage(object):
# TODO: Figure out how now to send a public when required, not always on start of the first message in the session
# 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'
:
if
self
.
content_type
!=
'text/pgp-public-key'
:
stream
=
self
.
session
.
fake_streams
.
get
(
'messages'
)
stream
=
self
.
session
.
fake_streams
.
get
(
'messages'
)
if
self
.
account
.
sms
.
enable_pgp
and
stream
.
can_en
crypt
:
if
self
.
session
.
account
.
sms
.
enable_pgp
and
stream
.
can_de
crypt
:
directory
=
os
.
path
.
join
(
SIPSimpleSettings
()
.
chat
.
keys_directory
.
normalized
,
'private'
)
directory
=
os
.
path
.
join
(
SIPSimpleSettings
()
.
chat
.
keys_directory
.
normalized
,
'private'
)
filename
=
os
.
path
.
join
(
directory
,
f
'{self.account.id}'
)
filename
=
os
.
path
.
join
(
directory
,
f
'{self.
session.
account.id}'
)
with
open
(
f
'{filename}.pubkey'
,
'rb'
)
as
f
:
with
open
(
f
'{filename}.pubkey'
,
'rb'
)
as
f
:
public_key
=
f
.
read
()
.
decode
()
public_key
=
f
.
read
()
.
decode
()
public_key_message
=
OutgoingMessage
(
self
.
account
,
self
.
contact
,
str
(
public_key
),
'text/pgp-public-key'
,
session
=
self
.
session
)
public_key_message
=
OutgoingMessage
(
self
.
session
.
account
,
self
.
contact
,
str
(
public_key
),
'text/pgp-public-key'
,
session
=
self
.
session
)
public_key_message
.
send
()
public_key_message
.
send
()
self
.
_send
()
self
.
_send
()
...
@@ -846,7 +846,7 @@ class MessageManager(object, metaclass=Singleton):
...
@@ -846,7 +846,7 @@ class MessageManager(object, metaclass=Singleton):
self
.
_add_contact_to_messages_group
(
blink_session
.
account
,
blink_session
.
contact
)
self
.
_add_contact_to_messages_group
(
blink_session
.
account
,
blink_session
.
contact
)
notification_center
.
post_notification
(
'BlinkGotMessage'
,
notification_center
.
post_notification
(
'BlinkGotMessage'
,
sender
=
blink_session
,
sender
=
blink_session
,
data
=
NotificationData
(
message
=
message
))
data
=
NotificationData
(
message
=
message
,
account
=
account
))
return
return
self
.
_handle_incoming_message
(
message
,
blink_session
,
account
)
self
.
_handle_incoming_message
(
message
,
blink_session
,
account
)
...
...
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