avatars!#227
Conversation
# Conflicts: # src/app/features/call/SmallWidget.ts
|
There are some fixes for the cinny calls needed. New mr atop this one coming soon... |
|
Does this work at all with the cinny call stuff/should I still merge it or are you gonna make a new pr? |
Yeah it works! I meant in upstream cinny the calls are still a little janky and I'd like to try to fix those. Would you prefer some other way of bringing in in element call rather than a submodule? Should there be an official sable element call fork? |
|
There probably should be an official fork. I'll probably make a github org soon and then we can store everything under that... anyway ill merge this in later today then. |
|
Yay! |
I bring in https://github.com/melogale/element-call/tree/avatars as a submodule for now.
Element call disables thumbnails in widget mode by default, and it can't really be overridden except by janky means. Forking element call allows us to set this up kind of cleanly though!
In element call, we add two new capabilities to the host-widget contract.
moe.sable.thumbnailsmoe.sable.media_proxyIf neither is set, fallback thumbnails will be used: the letter over color sort.
If
moe.sable.thumbnailsis set, element call will attempt to use the old unauthenticated media endpoint to grab thumbnails.If
moe.sable.media_proxyor both are set, will shoot for the authenticated endpoint, and hope and pray the client hosting the widget keeps its promise: adding authentication to the request, via a service worker or something.Sable automatically accepts all capability requests, so these are set, and in fact, we add on authentication to media requests in the service worker!
Since the frames in which widgets run have separate client ids, I simply look through the session list and find a session with the right base url. This is kind of odd: it could end up being for a different user on another tab.
But as things are, the server doesn't care: so long as its authenticated by a user on the server.
Ideally it would use the session info for the tab hosting the widget, but I couldn't come up with a super clean way of doing that doesn't distract from the proof of concept. Let me know if anyone has any ideas for that. Or if we don't care for now.
To test it, make sure you have the submodule and:
Or here!
https://sable.melogale.space
note:
There's at least one little bug here. The avatar size is negative sometimes, for example. Element call not used to avatars in a widget, I suppose. Keep an eye out...