File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,13 @@ def unflag_message(id, **options)
6969 post ( 'moderation/unflag' , data : payload )
7070 end
7171
72+ def query_message_flags ( filter_conditions , **options )
73+ params = options . merge ( {
74+ filter_conditions : filter_conditions
75+ } )
76+ get ( 'moderation/flags/message' , params : { payload : params . to_json } )
77+ end
78+
7279 def flag_user ( id , **options )
7380 payload = { target_user_id : id } . merge ( options )
7481 post ( 'moderation/flag' , data : payload )
Original file line number Diff line number Diff line change 145145 @client . unflag_message ( msg_id , user_id : @random_users [ 0 ] [ :id ] )
146146 end
147147
148+ it 'queries message flags' do
149+ msg_id = SecureRandom . uuid
150+ @channel . send_message ( {
151+ 'id' => msg_id ,
152+ 'text' => 'Hello world'
153+ } , @random_user [ :id ] )
154+
155+ @client . flag_message ( msg_id , user_id : @random_users [ 0 ] [ :id ] )
156+ response = @client . query_message_flags ( { 'user_id' => { '$in' => [ @random_user [ :id ] ] } } )
157+ expect ( response [ 'flags' ] . length ) . to eq 1
158+ end
159+
148160 it 'marks everything as read' do
149161 @client . mark_all_read ( @random_user [ :id ] )
150162 end
You can’t perform that action at this time.
0 commit comments