stickerpicker icon indicating copy to clipboard operation
stickerpicker copied to clipboard

Web server for multi-user sticker picker

Open tulir opened this issue 5 years ago • 10 comments

Currently the picker is just some static files, which means everyone has the same packs and they can only be configured server-side.

The project could include a simple web server which can serve different packs for different users, based on some identifier in the picker URL. Once that server exists, it could also have a bot or other interface that users can use to add packs to their own picker.

It shouldn't have any auth other than the unique ID in the URL, as widget authentication is a mess that's different on all platforms.

tulir avatar Sep 05 '20 13:09 tulir

As an alternative to including a webserver the potential bot could also provision all required static files into some subdir scheme like:

<webroot>/stickerpicker-user1-randomid/<stickerpicker-webdir>
<webroot>/stickerpicker-user2-randomid/<stickerpicker-webdir>

Bubu avatar Sep 05 '20 15:09 Bubu

I copied ./web/packs/index.json to index_h6wxarlac.json, deleted the packs in the file, I don't want to give to the user and added the following lines to the server {} in nginx.conf

  location /h6wxarlac {
    alias /opt/stickerpicker/web;
    try_files $uri $uri/ =404;
  }
  location /h6wxarlac/packs/index.json {
    alias /opt/stickerpicker/web/index_h6wxarlac.json;
    try_files $uri $uri/ =404;
  }

a22sc avatar Nov 26 '20 21:11 a22sc

msrd0/docker-stickerpicker does also support multiple profiles

LuckyTurtleDev avatar Oct 15 '21 16:10 LuckyTurtleDev

I would suggest adding an "Edit Visibility" button to the settings section so users can decide wich packs are visible to them. When the button is pressed, the window goes into an "edit mode" where packs can be enabled or disabled with a switch, just like in Dimension. The state could also be saved in the local storage like the other settings.

Here I made a small visual concept of how this idea could look in the UI:

https://user-images.githubusercontent.com/37185496/205553080-4554ad1a-6ec1-4c85-bc52-eb2c63044520.mp4

FulytheFox avatar Dec 05 '22 05:12 FulytheFox

Is it possible to add the sticker picker for all users or do they all have to add it to their m.widgets event in the devtools?

MattyBoombalatty avatar Jul 23 '24 22:07 MattyBoombalatty

Is it possible to add the sticker picker for all users or do they all have to add it to their m.widgets event in the devtools?

I'm using https://heptapod.host/intevation/fac/synapse-modules#static-account-data for this purpose

sebix avatar Jul 24 '24 09:07 sebix

Is it possible to add the sticker picker for all users or do they all have to add it to their m.widgets event in the devtools?

I'm using https://heptapod.host/intevation/fac/synapse-modules#static-account-data for this purpose

Does that automatically update existing user data, or is it necessary to have them change something about their profile before that's applied? Thanks.

MattyBoombalatty avatar Jul 24 '24 14:07 MattyBoombalatty

Does that automatically update existing user data, or is it necessary to have them change something about their profile before that's applied? Thanks.

No, it's not applied to all existing users. You need to do that by other means (I'm sure I did that my self, but don't remember the details)

sebix avatar Jul 24 '24 14:07 sebix

Does that automatically update existing user data, or is it necessary to have them change something about their profile before that's applied? Thanks.

No, it's not applied to all existing users. You need to do that by other means (I'm sure I did that my self, but don't remember the details)

Understood. Thanks for the help. If you do happen to remember what you did, please let me know.

MattyBoombalatty avatar Jul 24 '24 16:07 MattyBoombalatty

A cursory glance in the account_data table indicates that user account data would have to be manually set with a randomly generated UUID, followed by the rest of the JSON.

MattyBoombalatty avatar Jul 24 '24 17:07 MattyBoombalatty