diff --git a/moa/moa.patch b/moa/moa.patch index 212ace6..9a94548 100644 --- a/moa/moa.patch +++ b/moa/moa.patch @@ -804,7 +804,7 @@ index e57604b..050e87c 100644 Base.metadata.create_all(engine) diff --git a/moa/toot.py b/moa/toot.py -index 08aa61d..29426a3 100644 +index 08aa61d..02cee13 100644 --- a/moa/toot.py +++ b/moa/toot.py @@ -8,11 +8,11 @@ from moa.message import Message @@ -903,8 +903,8 @@ index 08aa61d..29426a3 100644 # We trust mastodon to return valid HTML - self.content = re.sub(r']*href="([^"]+)">[^<]*', '\g<1>', self.content) -+ self.content = re.sub(r']*href="([^"]+)">[^<]*', '\g<1>', -+ self.content) ++ self.content = re.sub(r']*href="([^"]+)">([^<]*)', ++ '\g<1> (\g<2>)', self.content) # We replace html br with new lines - self.content = "\n".join(re.compile(r'
', re.IGNORECASE).split(self.content)) @@ -980,7 +980,7 @@ index 08aa61d..29426a3 100644 else: logger.info('Truncating toot') diff --git a/moa/tweet.py b/moa/tweet.py -index b156967..0eeeaae 100644 +index b156967..95d4a96 100644 --- a/moa/tweet.py +++ b/moa/tweet.py @@ -20,6 +20,7 @@ HANDLE_SUFFIX = '' @@ -1079,16 +1079,17 @@ index b156967..0eeeaae 100644 else: content = self.data.full_text -@@ -271,6 +276,8 @@ class Tweet(Message): +@@ -271,6 +276,9 @@ class Tweet(Message): content = re.sub(url.url, url.expanded_url, content) if self.is_retweet: ++ self.media = [] + self.__content = f"RT @{self.data.retweeted_status.user.screen_name}{HANDLE_SUFFIX}\n{self.url}" + return self.__content if len(content) > 0: content = f"RT @{self.data.retweeted_status.user.screen_name}{HANDLE_SUFFIX}\n{content}" else: -@@ -366,13 +373,16 @@ class Tweet(Message): +@@ -366,13 +374,16 @@ class Tweet(Message): except (ConnectionError, NewConnectionError) as e: logger.error(f"{e}") attachment_url = None