Method: Codebot::Network#update_sasl

Defined in:
lib/codebot/network.rb

#update_sasl(disable, user, pass) ⇒ Object

Updates the SASL authentication details of this network.

Parameters:

  • disable (Boolean)

    whether to disable SASL, or nil to keep the current value.

  • user (String)

    the SASL username, or nil to keep the current value

  • pass (String)

    the SASL password, or nil to keep the current value



121
122
123
124
125
126
127
128
129
130
# File 'lib/codebot/network.rb', line 121

def update_sasl(disable, user, pass)
  @sasl_username = valid! user, valid_string(user), :@sasl_username,
                          invalid_error: 'invalid SASL username %s'
  @sasl_password = valid! pass, valid_string(pass), :@sasl_password,
                          invalid_error: 'invalid SASL password %s'
  return unless disable

  @sasl_username = nil
  @sasl_password = nil
end