From 7020706ff1c47dae93372e2c456a0b63aa72dd91 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 12 Feb 2020 06:27:21 -0400 Subject: [PATCH] items.py: rebase fix --- src/backend/models/items.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backend/models/items.py b/src/backend/models/items.py index 5514581a..08177971 100644 --- a/src/backend/models/items.py +++ b/src/backend/models/items.py @@ -12,7 +12,6 @@ from uuid import UUID import lxml # nosec import nio -from ..html_markdown import HTML_PROCESSOR from ..utils import AutoStrEnum, auto from .model_item import ModelItem @@ -168,16 +167,17 @@ class Event(ModelItem): id: str = field() event_id: str = field() + event_type: Type[nio.Event] = field() source: Optional[nio.Event] = field() date: datetime = field() sender_id: str = field() sender_name: str = field() sender_avatar: str = field() - content: str = "" - inline_content: str = "" - reason: str = "" - links: List[Dict[str, Any]] = field(default_factory=list) + content: str = "" + inline_content: str = "" + reason: str = "" + links: List[str] = field(default_factory=list) type_specifier: TypeSpecifier = TypeSpecifier.Unset @@ -208,13 +208,13 @@ class Event(ModelItem): return self.date > other.date @staticmethod - def parse_links(text: str) -> List[Dict[str, Any]]: + def parse_links(text: str) -> List[str]: """Return list of URLs (`` tags) present in the text.""" if not text.strip(): return [] - return [{"url": link[2]} for link in lxml.html.iterlinks(text)] + return [link[2] for link in lxml.html.iterlinks(text)] @property def serialized(self) -> Dict[str, Any]: