Skip to content

Commit b3a685e

Browse files
author
Rafael Marinho
committed
feat(cha-651): add location sharing support
1 parent 2448a2b commit b3a685e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/stream-chat/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ def query_drafts(user_id, filter: nil, sort: nil, **options)
832832
# @return [StreamChat::StreamResponse]
833833
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
834834
def get_active_live_locations(user_id)
835-
get('users/locations', params: { user_id: user_id })
835+
get('users/live_locations', params: { user_id: user_id })
836836
end
837837

838838
# Update live location
@@ -851,7 +851,7 @@ def update_location(user_id, created_by_device_id:, message_id:, **options)
851851
message_id: message_id
852852
}
853853
data.merge!(options) if options
854-
put('users/location', data: data, params: { user_id: user_id })
854+
put('users/live_locations', data: data, params: { user_id: user_id })
855855
end
856856

857857
# Gets a comamnd.

spec/client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,11 +1220,11 @@ def loop_times(times)
12201220

12211221
describe 'live locations' do
12221222
before(:all) do
1223-
@channel.update_partial({ config_overrides: { shared_locations: true } })
12241223
@location_test_user = { id: SecureRandom.uuid }
12251224
@client.upsert_users([@location_test_user])
12261225
@location_channel = @client.channel('messaging', channel_id: SecureRandom.uuid)
12271226
@location_channel.create(@location_test_user[:id])
1227+
@location_channel.update_partial({ config_overrides: { shared_locations: true } })
12281228
@location_message = @location_channel.send_message({ text: 'Location sharing message' }, @location_test_user[:id])
12291229
end
12301230

0 commit comments

Comments
 (0)