lib/chatrix/api/users.rb
def update_presence_status(user, status, message = nil)
        content = { presenceState: { presence: status } }

        content[:presenceState][:status_msg] = message if message

        make_request(:put, "/presence/#{user}/status", content: content)
          .code == 200
      end
# Updates the presence status of a user.
#
# @note Only the user for whom the {Matrix#access_token access_token} is
#   valid for can have their presence updated.
#
# @param user [String] The user to update.
# @param status [String] The new status to set. Eg. `'online'`
#   or `'offline'`.
# @param message [String,nil] If set,
#   associates a message with the status.
# @return [Boolean] `true` if the presence was updated successfully,
#   otherwise `false`.
Updates the presence status of a user.
Updates the presence status of a user .
def update_presence_status(user, status, message = nil)
        content = { presenceState: { presence: status } }
        content[:presenceState][:status_msg] = message if message
        make_request(:put, "/presence/#{user}/status", content: content)
          .code == 200
      end
def update_presence_status ( user , status , message = nil ) content = { presenceState : { presence : status } } content [ :presenceState ] [ :status_msg ] = message if message make_request ( :put , "/presence/#{user}/status" , content : content ) . code == 200 end
Updates the presence status of a user.
Updates the presence status of a user .
`true` if the presence was updated successfully, otherwise `false`.
` true ` if the presence was updated successfully otherwise ` false ` .
Boolean
user
The user to update.
The user to update .
status
The new status to set. Eg.
The new status to set . Eg .
message
If set, associates a message with the status.
If set associates a message with the status .
note
Only the user for whom the {Matrix#access_token access_token} is valid for can have their presence updated.
Only the user for whom the { Matrix#access_token access_token } is valid for can have their presence updated .