Terms&Conditions (#18) WIP:

* fix terms deletion.
This commit is contained in:
John Livingston 2024-06-25 12:40:00 +02:00
parent 2316c6b1fe
commit e6721b1fa8
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,9 @@ function get_muc_terms(room)
end
function set_muc_terms(room, terms)
terms = terms or nil;
if terms == "" then
terms = nil;
end
if get_muc_terms(room) == terms then return false; end

View File

@ -356,7 +356,7 @@ class RoomChannel {
// This can be done without waiting for the API call to finish, but we don't want to send thousands of
// API calls at the same time. So storing data in a map, and we well launch it sequentially at the end
prosodyRoomUpdates.set(roomJID, {
livechat_muc_terms: channelConfigurationOptions.terms
livechat_muc_terms: channelConfigurationOptions.terms ?? '' // must pass a string, else wont update
})
this.roomConfToUpdate.delete(roomJID)