Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nheko Reborn
nheko
Commits
a1968110
Verified
Commit
a1968110
authored
2 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fix notification format on windows
fixes #1137
parent
3517b650
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#3468
failed
2 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/notifications/ManagerWin.cpp
+2
-15
2 additions, 15 deletions
src/notifications/ManagerWin.cpp
with
2 additions
and
15 deletions
src/notifications/ManagerWin.cpp
+
2
−
15
View file @
a1968110
...
...
@@ -51,15 +51,8 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
const
QImage
&
icon
)
{
const
auto
room_name
=
QString
::
fromStdString
(
cache
::
singleRoomInfo
(
notification
.
room_id
).
name
);
const
auto
sender
=
cache
::
displayName
(
QString
::
fromStdString
(
notification
.
room_id
),
QString
::
fromStdString
(
mtx
::
accessors
::
sender
(
notification
.
event
)));
const
auto
isEncrypted
=
std
::
get_if
<
mtx
::
events
::
EncryptedEvent
<
mtx
::
events
::
msg
::
Encrypted
>>
(
&
notification
.
event
)
!=
nullptr
;
const
auto
isReply
=
utils
::
isReply
(
notification
.
event
);
auto
formatNotification
=
[
this
,
notification
,
sender
]
{
auto
formatNotification
=
[
this
,
notification
]
{
const
auto
template_
=
getMessageTemplate
(
notification
);
if
(
std
::
holds_alternative
<
mtx
::
events
::
EncryptedEvent
<
mtx
::
events
::
msg
::
Encrypted
>>
(
notification
.
event
))
{
...
...
@@ -69,18 +62,12 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
return
template_
.
arg
(
utils
::
stripReplyFallbacks
(
notification
.
event
,
{},
{}).
quoted_body
);
};
const
auto
line1
=
(
room_name
==
sender
)
?
sender
:
QString
(
"%1 - %2"
).
arg
(
sender
).
arg
(
room_name
);
const
auto
line2
=
(
isEncrypted
?
(
isReply
?
tr
(
"%1 replied with an encrypted message"
)
:
tr
(
"%1 sent an encrypted message"
))
:
formatNotification
());
auto
iconPath
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
CacheLocation
)
+
room_name
+
"-room-avatar.png"
;
if
(
!
icon
.
save
(
iconPath
))
iconPath
.
clear
();
systemPostNotification
(
line1
,
line2
,
iconPath
);
systemPostNotification
(
room_name
,
formatNotification
()
,
iconPath
);
}
void
...
...
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