Store "sender-pid" and fix Clippy lints#142
Store "sender-pid" and fix Clippy lints#142joshuamegnauth54 wants to merge 1 commit intopop-os:masterfrom
Conversation
I bundled the Clippy fixes with this commit since they're small and don't warrant its own PR. "sender-pid" is a hint set by some apps, such as Electron apps or "notify-send." It's useful as a more granular indicator than app ID because it's the PID of the sending app. For COSMIC Notifications, this commit fixes a warning but does not use "sender-pid" directly. It's stored for further use like the other hints.
| Hint::SenderPid(pid) => Some(*pid), | ||
| _ => None, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Is this usable by cosmic-notifications itself? It would help to have something to test this with.
There was a problem hiding this comment.
Yes, but I left it unused because I think System76 would have to decide what to do with it. For example, the group_notifications() function can use it to group by both PID and App ID instead of just PID. This PR only silences a warning that's printed to the system logs fairly often because sender-pid is a common hint.
I wrote the function you're referencing because some of the other hints have convenience functions like that. 😁
A quick way to test this before and after is to use notify-send which also sets the sender-pid hint. Run journalctl --user --follow in a separate tab then post some notifications with notify-send.
I bundled the Clippy fixes with this commit since they're small and don't warrant its own PR.
"sender-pid" is a hint set by some apps, such as Electron apps or "notify-send." It's useful as a more granular indicator than app ID because it's the PID of the sending app.
For COSMIC Notifications, this commit fixes a warning but does not use "sender-pid" directly. It's stored for further use like the other hints.