kopia lustrzana https://gitlab.com/jaywink/federation
Test for the Accept activity on Follow objects. If true, return the Accept activity from to_base.
rodzic
9f1cc9432f
commit
c574f69adc
|
@ -1104,10 +1104,13 @@ class Follow(Activity, base.Follow):
|
|||
return super().to_as2()
|
||||
|
||||
def to_base(self):
|
||||
# This is assuming Follow can only be the object of an Undo activity. Lazy.
|
||||
if self.activity != self:
|
||||
if isinstance(self.activity, Undo):
|
||||
self.following = False
|
||||
|
||||
# Socialhome doesn't know what to do with Accept objects yet.
|
||||
if isinstance(self.activity, Accept):
|
||||
return self.activity
|
||||
|
||||
return self
|
||||
|
||||
def post_receive(self) -> None:
|
||||
|
@ -1252,6 +1255,9 @@ class Like(Activity, base.Reaction):
|
|||
|
||||
# inbound Accept is a noop...
|
||||
class Accept(Create, base.Accept):
|
||||
def validate(self):
|
||||
pass
|
||||
|
||||
class Meta:
|
||||
rdf_type = as2.Accept
|
||||
exclude = ('created_at',)
|
||||
|
|
Ładowanie…
Reference in New Issue