Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Matrix Gatcha Bot
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Déploiement
Releases
Registre de modèles
Analyse
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Kubat
Matrix Gatcha Bot
Validations
ab597b09
Vérifiée
Valider
ab597b09
rédigé
Il y a 3 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Don't re-handle already seem messages
parent
8cf4f590
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
src/main.rs
+9
-12
9 ajouts, 12 suppressions
src/main.rs
avec
9 ajouts
et
12 suppressions
src/main.rs
+
9
−
12
Voir le fichier @
ab597b09
...
@@ -14,7 +14,7 @@ use matrix_sdk::{
...
@@ -14,7 +14,7 @@ use matrix_sdk::{
},
},
UserId
,
UserId
,
},
},
Client
,
Result
,
SyncSettings
,
Client
,
LoopCtrl
,
Result
,
SyncSettings
,
RoomInfo
,
};
};
use
matrix_sdk
::
ruma
::{
events
::
SyncStateEvent
,
Int
,
MilliSecondsSinceUnixEpoch
};
use
matrix_sdk
::
ruma
::{
events
::
SyncStateEvent
,
Int
,
MilliSecondsSinceUnixEpoch
};
...
@@ -77,7 +77,7 @@ async fn main() -> Result<()> {
...
@@ -77,7 +77,7 @@ async fn main() -> Result<()> {
println!
(
"Logged as: {}"
,
alice
);
println!
(
"Logged as: {}"
,
alice
);
// Don't respond to old messages
// Don't respond to old messages
//
client.sync_once(SyncSettings::default()).await?;
client
.sync_once
(
SyncSettings
::
default
())
.await
?
;
// https://docs.rs/ruma/0.4.0/ruma/events/enum.AnySyncMessageEvent.html
// https://docs.rs/ruma/0.4.0/ruma/events/enum.AnySyncMessageEvent.html
client
client
...
@@ -85,21 +85,18 @@ async fn main() -> Result<()> {
...
@@ -85,21 +85,18 @@ async fn main() -> Result<()> {
|
ev
:
SyncMessageEvent
<
MessageEventContent
>
,
|
ev
:
SyncMessageEvent
<
MessageEventContent
>
,
room
:
Room
,
room
:
Room
,
encryption_info
:
Option
<
EncryptionInfo
>
|
async
move
{
encryption_info
:
Option
<
EncryptionInfo
>
|
async
move
{
println!
(
"---
\n
ROOM: {:?}
\n
ENC: {:?}
\n
SME: {:?}"
,
room
,
encryption_info
,
ev
);
println!
(
"---
\n
ROOM: {:?}
\n
ENC: {:?}
\n
SME: {:?}"
,
room
,
encryption_info
,
ev
);
},
},
)
)
.await
;
.await
;
client
.register_event_handler
(|
ev
:
SyncStateEvent
<
TopicEventContent
>
|
async
move
{
// You can omit any or all arguments after the first.
})
.await
;
// Because we sync once already we must pass the previous sync token
// let settings = SyncSettings::default().token(client.sync_token().await.unwrap());
println!
(
"Entering sync loop"
);
println!
(
"Entering sync loop"
);
// client.sync(settings).await;
let
token
=
client
.sync_token
()
.await
.unwrap
();
client
.sync
(
SyncSettings
::
default
())
.await
;
let
settings
=
SyncSettings
::
default
()
.token
(
token
);
client
.sync
(
settings
)
.await
;
Ok
(())
Ok
(())
}
}
Err
(
e
)
=>
panic!
(
Err
(
e
)
=>
panic!
(
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter