Mention and notify users when creating a status

This commit is contained in:
Mouse Reeve
2020-11-01 10:13:51 -08:00
parent 4684a83e6f
commit 0cf1838276
6 changed files with 83 additions and 12 deletions

View File

@ -3,8 +3,9 @@ import inspect
import sys
from .base_activity import ActivityEncoder, Image, PublicKey, Signature
from .base_activity import Link, Mention
from .note import Note, GeneratedNote, Article, Comment, Review, Quotation
from .note import Tombstone, Link
from .note import Tombstone
from .interaction import Boost, Like
from .ordered_collection import OrderedCollection, OrderedCollectionPage
from .person import Person

View File

@ -21,6 +21,19 @@ class Image:
type: str = 'Image'
@dataclass
class Link():
''' for tagging a book in a status '''
href: str
name: str
type: str = 'Link'
@dataclass
class Mention(Link):
''' a subtype of Link for mentioning an actor '''
type: str = 'Mention'
@dataclass
class PublicKey:
''' public key block '''

View File

@ -2,7 +2,7 @@
from dataclasses import dataclass, field
from typing import Dict, List
from .base_activity import ActivityObject, Image
from .base_activity import ActivityObject, Image, Link
@dataclass(init=False)
class Tombstone(ActivityObject):
@ -20,6 +20,7 @@ class Note(ActivityObject):
inReplyTo: str
published: str
attributedTo: str
tag: List[Link]
to: List[str]
cc: List[str]
content: str
@ -36,17 +37,9 @@ class Article(Note):
type: str = 'Article'
@dataclass
class Link():
''' for tagging a book in a status '''
href: str
name: str
type: str = 'Link'
@dataclass(init=False)
class GeneratedNote(Note):
''' just a re-typed note '''
tag: List[Link]
type: str = 'GeneratedNote'