mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-30 00:41:42 +00:00
Mention relationships (but not used by UI for example)
This commit is contained in:
parent
43717984e2
commit
38a5afe16a
@ -142,6 +142,22 @@ pub async fn process_new_event(
|
|||||||
Globals::add_relationship(id, event.id, Relationship::Reply).await;
|
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
|
// reacts to
|
||||||
if let Some((id, reaction, _maybe_url)) = event.reacts_to() {
|
if let Some((id, reaction, _maybe_url)) = event.reacts_to() {
|
||||||
if from_relay {
|
if from_relay {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum Relationship {
|
pub enum Relationship {
|
||||||
Reply,
|
Reply,
|
||||||
//Mention,
|
Mention,
|
||||||
Reaction(String),
|
Reaction(String),
|
||||||
Deletion(String),
|
Deletion(String),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user