Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
b5f531a4
Commit
b5f531a4
authored
3 years ago
by
Daniel Brötzmann
Committed by
Philipp Hörist
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ChatList: Properly split newlines
parent
b48db8fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/gtk/chat_list.py
+11
-6
11 additions, 6 deletions
gajim/gtk/chat_list.py
with
11 additions
and
6 deletions
gajim/gtk/chat_list.py
+
11
−
6
View file @
b5f531a4
...
...
@@ -14,6 +14,7 @@
import
logging
import
time
from
typing
import
Optional
from
gi.repository
import
Gio
from
gi.repository
import
Gdk
...
...
@@ -29,6 +30,7 @@
from
gajim.common.helpers
import
get_groupchat_name
from
gajim.common.helpers
import
get_group_chat_nick
from
gajim.common.helpers
import
get_uf_relative_time
from
gajim.common.helpers
import
AdditionalDataDict
from
gajim.common.preview_helpers
import
filename_from_uri
from
gajim.common.preview_helpers
import
guess_simple_file_type
...
...
@@ -667,7 +669,9 @@ def set_nick(self, nickname):
self
.
_ui
.
nick_label
.
set_visible
(
bool
(
nickname
))
self
.
_ui
.
nick_label
.
set_text
(
nickname
)
def
set_message_text
(
self
,
text
,
icon_name
=
None
,
additional_data
=
None
):
def
set_message_text
(
self
,
text
:
str
,
icon_name
:
Optional
[
str
]
=
None
,
additional_data
:
Optional
[
AdditionalDataDict
]
=
None
)
->
None
:
icon
=
None
if
icon_name
is
not
None
:
icon
=
Gio
.
Icon
.
new_for_string
(
icon_name
)
...
...
@@ -676,12 +680,13 @@ def set_message_text(self, text, icon_name=None, additional_data=None):
text
,
additional_data
):
file_name
=
filename_from_uri
(
text
)
icon
,
file_type
=
guess_simple_file_type
(
text
)
text
=
'
%(
file_type
)s (%(
file_name
)s)
'
%
{
'
file_type
'
:
file_type
,
'
file_name
'
:
file_name
}
else
:
text
=
text
.
replace
(
'
\n
'
,
'
'
)
text
=
f
'
{
file_type
}
(
{
file_name
}
)
'
# Split by newline and display last line
lines
=
text
.
split
(
'
\n
'
)
text
=
lines
[
-
1
]
self
.
_ui
.
message_label
.
set_text
(
text
)
if
icon
is
None
:
self
.
_ui
.
message_icon
.
hide
()
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment