provide the Telegram bot name in the user configuration dialog
Expected behavior
A user of the app should be able to setup e.g. the Telegram gateway without further involvement of the administrator, who has set-up the original gateway. Therefore the name of the already set-up Telegram bot should be displayed in the personal settings of the app configuration. The name should be provided as a hyperlink named @my_nc_bot with the underlying url http://telegram.me/my_nc_bot.
(Most likely this can be handled similar to setup other gateways too)
The required name of the bot can prgrammatically be evaluated by forcing the following api request:
https://api.telegram.org/bot<token>/getMe
{
"ok":true,
"result":{
"id": 123456789,
"is_bot": true,
"first_name": "My own NC bot",
"username": "my_nc_bot" # <<<
}
}
Current behavior
The name of the configured Telegram bot is now shown in the setup dialog and has be provided by the administrator in any way.
Steps to reproduce
- Open Settings -> Personal -> Security and navigate to the
Message gateway second-factor authconfiguration. - Check the dialog.
Environment
Server Configuration
OS: Linux 3.16.50 Web server: Apache2 2.4.37 Database: MariaDB 10.2.19 PHP version: 7.2.13 Nextcloud version: 15.0.0 Twofactor_gateway app version: 0.11.0
Client Configuration
Browser: Mozilla Firefox 64.0 Operating system: Windows 10