kopia lustrzana https://github.com/tsileo/little-boxes
Add new get_in_reply_to helper
rodzic
3c6ba44ae6
commit
27279d3306
|
@ -914,6 +914,16 @@ class Note(BaseActivity):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_in_reply_to(self) -> Optional[str]:
|
||||||
|
if self.inReplyTo is None:
|
||||||
|
return None
|
||||||
|
elif isinstance(self.inReplyTo, str):
|
||||||
|
return self.inReplyTo
|
||||||
|
elif isinstance(self.inReplyTo, dict):
|
||||||
|
return self.inReplyTo["id"]
|
||||||
|
else:
|
||||||
|
raise ValueError(f"unexpected inReplyTo: {self.inReplyTo}")
|
||||||
|
|
||||||
|
|
||||||
class Question(Note):
|
class Question(Note):
|
||||||
ACTIVITY_TYPE = ActivityType.QUESTION
|
ACTIVITY_TYPE = ActivityType.QUESTION
|
||||||
|
|
Ładowanie…
Reference in New Issue