lib/chatrix/api/users.rb
def update_presence_list(user, data)
        make_request(
          :post,
          "/presence/list/#{user}",
          content: { presence_diff: data }
        ).code == 200
      end
# Adds or removes users from a user's presence list.
#
# @param user [String] The user whose list to modify.
# @param data [Hash{String=>Array<String>}] Contains two arrays,
#   `invite` and `drop`. Users listed in the `invite` array will be
#   invited to join the presence list. Users listed in the `drop` array
#   will be removed from the presence list.
#   Note that both arrays are not required but at least one must be
#   present.
# @return [Boolean] `true` if the list was successfully updated,
#   otherwise `false`.
#
# @example Add and remove two users
#   update_presence_list(
#     '@me:home.org',
#     {
#       invite: ['@friend:home.org'],
#       drop: ['@enemy:other.org']
#     }
#   )
Adds or removes users from a user's presence list.
Adds or removes users from a user ' s presence list .
def update_presence_list(user, data)
        make_request(
          :post,
          "/presence/list/#{user}",
          content: { presence_diff: data }
        ).code == 200
      end
def update_presence_list ( user , data ) make_request ( :post , "/presence/list/#{user}" , content : { presence_diff : data } ) . code == 200 end
Adds or removes users from a user's presence list.
Adds or removes users from a user ' s presence list .
`true` if the list was successfully updated, otherwise `false`.
` true ` if the list was successfully updated otherwise ` false ` .
Boolean
user
The user whose list to modify.
The user whose list to modify .
data
Contains two arrays, `invite` and `drop`. Users listed in the `invite` array will be invited to join the presence list. Users listed in the `drop` array will be removed from the presence list. Note that both arrays are not required but at least one must be present.
Contains two arrays ` invite ` and ` drop ` . Users listed in the ` invite ` array will be invited to join the presence list . Users listed in the ` drop ` array will be removed from the presence list . Note that both arrays are not required but at least one must be present .
example
Add and remove two users update_presence_list( '@me:home.org', { invite: ['@friend:home.org'], drop: ['@enemy:other.org'] } )
Add and remove two users update_presence_list ( ' @me : home . org ' { invite : [ ' @friend : home . org ' ] drop : [ ' @enemy : other . org ' ] } )