summaryrefslogtreecommitdiffstats
path: root/activities/models/timeline_event.py
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-16 06:53:39 -0700
committerAndrew Godwin2022-11-16 13:53:40 -0700
commit495e955378d62dc439c4c210785e5d401bc77f64 (patch)
tree859813b06314f387470295e752d1f1b3828830a7 /activities/models/timeline_event.py
parent906ed2f27c9105dbd78f416930f1aa2b49497567 (diff)
downloadtakahe-495e955378d62dc439c4c210785e5d401bc77f64.tar.gz
takahe-495e955378d62dc439c4c210785e5d401bc77f64.tar.bz2
takahe-495e955378d62dc439c4c210785e5d401bc77f64.zip
Tag and visibility handling
Diffstat (limited to 'activities/models/timeline_event.py')
-rw-r--r--activities/models/timeline_event.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/activities/models/timeline_event.py b/activities/models/timeline_event.py
index 29dec19..368fdad 100644
--- a/activities/models/timeline_event.py
+++ b/activities/models/timeline_event.py
@@ -82,6 +82,17 @@ class TimelineEvent(models.Model):
)[0]
@classmethod
+ def add_mentioned(cls, identity, post):
+ """
+ Adds a mention of identity by post
+ """
+ return cls.objects.get_or_create(
+ identity=identity,
+ type=cls.Types.mentioned,
+ subject_post=post,
+ )[0]
+
+ @classmethod
def add_post_interaction(cls, identity, interaction):
"""
Adds a boost/like to the timeline if it's not there already.