cinnyapp / cinny-desktop

Yet another matrix client for desktop
GNU Affero General Public License v3.0
415 stars 49 forks source link

Identify Cinny desktop as such, rather than as Cinny Web #375

Closed Porkepix closed 1 month ago

Porkepix commented 1 month ago

Describe the problem

Currently, Cinny desktop identify itself as "Cinny Web" by default in the list of Matrix sessions.

Describe the solution you'd like

Showing as "Cinny desktop" by default would be less confusing (it could even include OS and/or a unique ID).

Alternatives considered

None, it's just an improvement over the current situation.

Additional context

I thought there may have been some variables that could be used for that purpose, but only found https://github.com/cinnyapp/cinny-desktop/blob/main/config.json which seems identical to the one at https://github.com/cinnyapp/cinny/blob/dev/config.json so it wasn't the way.

Searching through the repo with "Cinny Web" though I could find from the main repo these results:

src/client/state/cons.js
9:  DEVICE_DISPLAY_NAME: 'Cinny Web',

src/app/pages/auth/register/PasswordRegisterForm.tsx
112:        initial_device_display_name: 'Cinny Web',
253:      initial_device_display_name: 'Cinny Web',

src/app/pages/auth/login/PasswordLoginForm.tsx
136:      initial_device_display_name: 'Cinny Web',
154:      initial_device_display_name: 'Cinny Web',
166:      initial_device_display_name: 'Cinny Web',

src/app/pages/auth/login/TokenLogin.tsx
60:      initial_device_display_name: 'Cinny Web',

Which led me to search for DEVICE_DISPLAY_NAME found only at

src/client/state/cons.js
9:  DEVICE_DISPLAY_NAME: 'Cinny Web',

This seems declared but never used.

On the other hand, looking for initial_device_display_name found many matches where this is set manually everytime:

❯  rg initial_device_display_name
src/app/pages/auth/register/PasswordRegisterForm.tsx
112:        initial_device_display_name: 'Cinny Web',
253:      initial_device_display_name: 'Cinny Web',

src/app/pages/auth/login/PasswordLoginForm.tsx
136:      initial_device_display_name: 'Cinny Web',
154:      initial_device_display_name: 'Cinny Web',
166:      initial_device_display_name: 'Cinny Web',

src/app/pages/auth/login/TokenLogin.tsx
60:      initial_device_display_name: 'Cinny Web',

So I was wondering if DEVICE_DISPLAY_NAME already set shouldn't be used instead of redeclaring this everytime? And if there would be a way to declare that variable for the Desktop application so that it's passed at cinyapp during build and use something else?

kfiven commented 1 month ago

duplicate of #64

Porkepix commented 1 month ago

@kfiven Then would you want most of the message to be replicated in the other issue/another issue in Cinny app repo?

Because here I was also pointing on a seemingly unused variable, and to placed where it'd make sense to have it used.

(Note though that I'm absolutely not familiar of JS and its families codebases).

kfiven commented 1 month ago

I don't think there's a need to mention as the issue is already linked in that issue now.

Porkepix commented 1 month ago

Yes but I mean, the possible unused variables and placed it could be used belongs to the other repo, if that was worth something, right?

kfiven commented 1 month ago

IMO it's not worth filling issue for that, when somebody (hopefully) will try to fix this issue, they will have to play with that code anyways and as it is now, it's not causing any issues.