mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 10:45:21 +00:00
implement channel password management at local and /pass command handling.
This commit is contained in:
@@ -284,9 +284,21 @@ class ChannelManager(
|
||||
state.setShowPasswordPrompt(false)
|
||||
state.setPasswordPromptChannel(null)
|
||||
}
|
||||
|
||||
fun setChannelPassword(channel: String, password: String): Boolean {
|
||||
return verifyChannelPassword(channel, password)
|
||||
|
||||
fun setChannelPassword(channel: String, password: String) {
|
||||
|
||||
channelPasswords[channel] = password
|
||||
|
||||
channelKeys[channel] = deriveChannelKey(password, channel)
|
||||
|
||||
state.setPasswordProtectedChannels(
|
||||
state.getPasswordProtectedChannelsValue().toMutableSet().apply { add(channel) }
|
||||
)
|
||||
|
||||
dataManager.saveChannelData(
|
||||
state.getJoinedChannelsValue(),
|
||||
state.getPasswordProtectedChannelsValue()
|
||||
)
|
||||
}
|
||||
|
||||
// MARK: - Emergency Clear
|
||||
|
||||
Reference in New Issue
Block a user