File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -18,20 +18,23 @@ async fn log_messages(
1818 username : & str ,
1919 password : & str ,
2020) -> anyhow:: Result < ( ) > {
21+ // Construct and log in the client.
2122 let client = ruma_client:: Client :: builder ( )
2223 . homeserver_url ( homeserver_url)
2324 . build :: < HttpClient > ( )
2425 . await ?;
2526
2627 client. log_in ( username, password, None , None ) . await ?;
2728
29+ // Perform an initial sync to ignore messages before the bot was launched.
2830 let filter = FilterDefinition :: ignore_all ( ) . into ( ) ;
2931 let initial_sync_response = client
3032 . send_request ( assign ! ( sync_events:: v3:: Request :: new( ) , {
3133 filter: Some ( filter) ,
3234 } ) )
3335 . await ?;
3436
37+ // Launch a sync loop to listen to new messages.
3538 let mut sync_stream = Box :: pin ( client. sync (
3639 None ,
3740 initial_sync_response. next_batch ,
You can’t perform that action at this time.
0 commit comments