fix: update TalkService for Talk 14 compatibility and add CLI copy helper
- **TalkService**: - Refactored `ensureBotParticipants` to use `AttendeeMapper` directly, removing the dependency on `ParticipantService`. - Added `getBotDisplayNameForRoom` to resolve the bot's display name via direct DB query. - Updated `sendMessage` to use Chat API v1 and include `richObjectsEnd`. - Improved `getBaseUrl` logic to handle `overwritehost` and `overwritewebroot`. - **WebhookController**: - Fixed `getAllValues` to iterate known keys manually, preventing `RuntimeException` in Nextcloud 33. - Added error handling for `saveConfig`. - Removed unused `ParticipantService` import. - **js/settings.js**: - Added functionality to copy CLI commands to the clipboard. - **Deletions**: - Removed `lib/Command/AddBotParticipant.php` as its logic is now integrated into `TalkService`. - **Templates**: - Updated admin settings labels and comments.
This commit is contained in:
@@ -39,6 +39,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
savePasswordBtn.style.display = this.value.trim() ? 'inline-block' : 'none';
|
||||
});
|
||||
|
||||
// Copy CLI commands to clipboard
|
||||
document.querySelectorAll('.nc-copy-btn').forEach(function (btn) {
|
||||
btn.addEventListener('click', function () {
|
||||
var text = this.dataset.copy || '';
|
||||
navigator.clipboard.writeText(text).then(function () {
|
||||
var orig = this.textContent;
|
||||
this.textContent = '✓';
|
||||
this.style.color = '#28a745';
|
||||
setTimeout(function () {
|
||||
btn.textContent = orig;
|
||||
btn.style.color = '';
|
||||
}, 2000);
|
||||
}.bind(this));
|
||||
});
|
||||
});
|
||||
|
||||
// Fetch available Talk rooms
|
||||
function fetchRooms() {
|
||||
fetchRoomsBtn.disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user