stream-chat-ruby 3.18.0 → 3.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84015e1d070503f9f6078ee5cd287742ddf5dc7fc0c740021a16dd4e20038d26
4
- data.tar.gz: caaeb73673bc7711ebda06b9ceb90429f53f64dcb5da3158e6ee05fe20ebbb89
3
+ metadata.gz: 5db7a309b5bd19d9f2fadad656bc0d476cd8534f1dfded9dd10b7b590940391a
4
+ data.tar.gz: 981f539a03b410d776c71991a197f96509a7bbebc3a70b99ceb6a04792f75d2e
5
5
  SHA512:
6
- metadata.gz: eb8017becca4ae15c9fd12cd0455355e42c73dc2153d1ae12a235360a70cd679e4dda518444a2bacdd15f069ff0786b7c29cdc3969dcb5f2e4875a29f65707e6
7
- data.tar.gz: b19f118cd243550bceb3b5b1fcce954ceaedb80134cf9827b3471856d5509b003e2ebd1826203d31f6a35089cf1f8e34b1090495f31d47cac5750723e282cb9b
6
+ metadata.gz: 7ac9c69e1f2fa0e6fff9bbcc1d47b6f920663629042b9619fe419134987fecfa7651523a844109c4a69002e5eaf9b6112f3ee90a0b3f3236b99f2f2297e96588
7
+ data.tar.gz: bcb37ce16bffe36551977e592a739a053738f4d7c6735ee2edaaf63ea7596f0cfedf8178066627fa92dbe7eed11d8feda57d1b5484b36723b347ccd52581abb2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.19.1](https://github.com/GetStream/stream-chat-ruby/compare/v3.19.0...v3.19.1) (2025-09-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * Added `Delete for me` support on behalf of a user ([#178](https://github.com/GetStream/stream-chat-ruby/issues/178)) ([770a441](https://github.com/GetStream/stream-chat-ruby/commit/770a441ff6243ab6d10fde7daa2b75b4137c4db0))
11
+
12
+ ## [3.19.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.18.0...v3.19.0) (2025-07-07)
13
+
5
14
  ## [3.18.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.17.0...v3.18.0) (2025-06-30)
6
15
 
7
16
  ## [3.17.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.16.0...v3.17.0) (2025-06-25)
@@ -431,6 +431,36 @@ module StreamChat
431
431
  delete("messages/#{message_id}", params: options)
432
432
  end
433
433
 
434
+ # Deletes a message with hard delete option.
435
+ sig { params(message_id: String).returns(StreamChat::StreamResponse) }
436
+ def hard_delete_message(message_id)
437
+ delete_message(message_id, hard: true)
438
+ end
439
+
440
+ # Deletes a message with delete_for_me option.
441
+ sig { params(message_id: String, user_id: String).returns(StreamChat::StreamResponse) }
442
+ def delete_message_for_me(message_id, user_id)
443
+ raise ArgumentError, 'user_id must not be empty for delete_for_me functionality' if user_id.to_s.empty?
444
+
445
+ delete_message(message_id, delete_for_me: true, deleted_by: user_id)
446
+ end
447
+
448
+ # Deletes a message with advanced options.
449
+ sig { params(message_id: String, hard: T.nilable(T::Boolean), delete_for_me: T.nilable(T::Boolean), user_id: T.nilable(String)).returns(StreamChat::StreamResponse) }
450
+ def delete_message_with_options(message_id, hard: nil, delete_for_me: nil, user_id: nil)
451
+ options = {}
452
+ options[:hard] = true if hard
453
+
454
+ if delete_for_me
455
+ raise ArgumentError, 'user_id must not be empty for delete_for_me functionality' if user_id.to_s.empty?
456
+
457
+ options[:delete_for_me] = true
458
+ options[:deleted_by] = user_id
459
+ end
460
+
461
+ delete_message(message_id, **options)
462
+ end
463
+
434
464
  # Un-deletes a message.
435
465
  sig { params(message_id: String, undeleted_by: String, options: T.untyped).returns(StreamChat::StreamResponse) }
436
466
  def undelete_message(message_id, undeleted_by, **options)
@@ -827,6 +857,33 @@ module StreamChat
827
857
  post('drafts/query', data: data)
828
858
  end
829
859
 
860
+ # Get active_live_locations for the current user
861
+ #
862
+ # @return [StreamChat::StreamResponse]
863
+ sig { params(user_id: String).returns(StreamChat::StreamResponse) }
864
+ def get_active_live_locations(user_id)
865
+ get('users/live_locations', params: { user_id: user_id })
866
+ end
867
+
868
+ # Update live location
869
+ #
870
+ # @param [String] user_id The ID of the user to update the location
871
+ # @param [String] created_by_device_id The device ID that created the location
872
+ # @param [String] message_id The message ID associated with the location
873
+ # @param [Float] latitude Optional latitude coordinate
874
+ # @param [Float] longitude Optional longitude coordinate
875
+ # @param [String] end_at Optional end time for the location sharing
876
+ # @return [StreamChat::StreamResponse]
877
+ sig { params(user_id: String, created_by_device_id: String, message_id: String, options: T.untyped).returns(StreamChat::StreamResponse) }
878
+ def update_location(user_id, created_by_device_id:, message_id:, **options)
879
+ data = {
880
+ created_by_device_id: created_by_device_id,
881
+ message_id: message_id
882
+ }
883
+ data.merge!(options) if options
884
+ put('users/live_locations', data: data, params: { user_id: user_id })
885
+ end
886
+
830
887
  # Gets a comamnd.
831
888
  sig { params(name: String).returns(StreamChat::StreamResponse) }
832
889
  def get_command(name)
@@ -1046,7 +1103,7 @@ module StreamChat
1046
1103
  headers['Authorization'] = @auth_token
1047
1104
  headers['stream-auth-type'] = 'jwt'
1048
1105
  params = {} if params.nil?
1049
- params = (get_default_params.merge(params).sort_by { |k, _v| k.to_s }).to_h
1106
+ params = get_default_params.merge(params).sort_by { |k, _v| k.to_s }.to_h
1050
1107
  url = "#{relative_url}?#{URI.encode_www_form(params)}"
1051
1108
 
1052
1109
  body = data.to_json if %w[patch post put].include? method.to_s
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module StreamChat
5
- VERSION = '3.18.0'
5
+ VERSION = '3.19.1'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stream-chat-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.18.0
4
+ version: 3.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - getstream.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-30 00:00:00.000000000 Z
11
+ date: 2025-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday