boxdot / gurk-rs

Signal Messenger client for terminal
GNU Affero General Public License v3.0
456 stars 33 forks source link

Profile pictures in notifications #236

Open maximbaz opened 12 months ago

maximbaz commented 12 months ago

I'd love to have a profile picture of a sender in the desktop notification (if they have it). For that to work, I assume the avatars would need to be stored on disk.

Then we'd be able to pass them to Notification::new().summary(summary).body(text).image_path(avatar_path).show() like so.

I couldn't find anything about profiles in the code, how difficult do you think it would be to get the avatars saved? Could you share some pointers how you would implement this?

boxdot commented 12 months ago

We already retrieve profiles in resolve_name_from_profile in src/signal/impl.rs. At the moment, only profile name is used. However, the returned Profile struct does not contain the avatar. Digging deeper in the stack (gurk uses presage which uses libsignal-service-rs) they throw away the avatar in this place during decryption: https://github.com/whisperfish/libsignal-service-rs/blob/5dfe90b5caa90ede538e9b508a44544c0733a704/libsignal-service/src/push_service.rs#L318

I would take presage's cli example and use it to extend libsignal-service-rs.