nextcloud / spreed

🗨️ Nextcloud Talk – chat, video & audio calls for Nextcloud
https://nextcloud.com/talk
GNU Affero General Public License v3.0
1.63k stars 436 forks source link

Allow changing of bot url after installation #11357

Open SystemKeeper opened 9 months ago

SystemKeeper commented 9 months ago

How to use GitHub


Is your feature request related to a problem? Please describe. Currently it is only possible to set the url of a bot when installing the bot via occ talk:bot:install.

Describe the solution you'd like As you can change the features of a bot through occ talk:bot:state, it would make sense to also allow changing the url.

Describe alternatives you've considered Removing the bot and install it with the new url, but this means that all rooms that had a bot enabled, need to enable that bot again.

nickvergessen commented 9 months ago

It's a bit problematic as the URL is used as a hash to identify the bot. When we change the URL/hash, we can no longer link old messages to that bot and therefor not show the display name: https://github.com/nextcloud/spreed/blob/d47ab76a29863269041997e5cd8bcb6f5a05cfdf/lib/Chat/MessageParser.php#L132

SystemKeeper commented 9 months ago

the URL is used as a hash to identify the bot.

But this also means that when I uninstall a bot and install a new one with the same URL, all old message will then show the new name?

nickvergessen commented 9 months ago

Jup, current assumption is that URLs are unique enough. Bots also have an autoincrement ID, not sure why I didn't use that one for the actor_id 🤔