Mention relationships (but not used by UI for example)

This commit is contained in:
Mike Dilger 2023-01-25 08:51:49 +13:00
parent 43717984e2
commit 38a5afe16a
2 changed files with 17 additions and 1 deletions

View File

@ -142,6 +142,22 @@ pub async fn process_new_event(
Globals::add_relationship(id, event.id, Relationship::Reply).await;
}
// mentions
for (id, _) in event.mentions() {
if from_relay {
let db_event_relationship = DbEventRelationship {
original: event.id.as_hex_string(),
refers_to: id.as_hex_string(),
relationship: "mention".to_string(),
content: None,
};
db_event_relationship.insert().await?;
}
// Insert into relationships
Globals::add_relationship(id, event.id, Relationship::Mention).await;
}
// reacts to
if let Some((id, reaction, _maybe_url)) = event.reacts_to() {
if from_relay {

View File

@ -2,7 +2,7 @@
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Relationship {
Reply,
//Mention,
Mention,
Reaction(String),
Deletion(String),
}