Add support for viewing emoji reacts
This commit is contained in:
parent
ae6999e111
commit
7ea714e61c
2 changed files with 14 additions and 0 deletions
|
@ -224,6 +224,15 @@ class FilterResult:
|
||||||
status_matches: Optional[str]
|
status_matches: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class EmojiReaction:
|
||||||
|
account_ids: List[str]
|
||||||
|
count: int
|
||||||
|
me: bool
|
||||||
|
name: str
|
||||||
|
url: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Status:
|
class Status:
|
||||||
"""
|
"""
|
||||||
|
@ -260,6 +269,7 @@ class Status:
|
||||||
bookmarked: Optional[bool]
|
bookmarked: Optional[bool]
|
||||||
pinned: Optional[bool]
|
pinned: Optional[bool]
|
||||||
filtered: Optional[List[FilterResult]]
|
filtered: Optional[List[FilterResult]]
|
||||||
|
emoji_reactions: Optional[List[EmojiReaction]]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def original(self) -> "Status":
|
def original(self) -> "Status":
|
||||||
|
|
|
@ -292,6 +292,9 @@ def print_status(status: Status, width: int = 80):
|
||||||
if display_name:
|
if display_name:
|
||||||
spacing -= wcswidth(display_name) + 1
|
spacing -= wcswidth(display_name) + 1
|
||||||
|
|
||||||
|
reacts = '\n'.join([f'{react.count} × {react.name}'
|
||||||
|
for react in status.emoji_reactions])
|
||||||
|
|
||||||
print_out(
|
print_out(
|
||||||
f"<green>{display_name}</green>" if display_name else "",
|
f"<green>{display_name}</green>" if display_name else "",
|
||||||
f"<blue>{username}</blue>",
|
f"<blue>{username}</blue>",
|
||||||
|
@ -315,6 +318,7 @@ def print_status(status: Status, width: int = 80):
|
||||||
print_out()
|
print_out()
|
||||||
|
|
||||||
print_out(
|
print_out(
|
||||||
|
f"Reacts:\n{reacts}\n" if reacts else "",
|
||||||
f"ID <yellow>{status_id}</yellow> ",
|
f"ID <yellow>{status_id}</yellow> ",
|
||||||
f"↲ In reply to <yellow>{in_reply_to_id}</yellow> " if in_reply_to_id else "",
|
f"↲ In reply to <yellow>{in_reply_to_id}</yellow> " if in_reply_to_id else "",
|
||||||
f"↻ <blue>@{reblogged_by.acct}</blue> boosted " if reblogged_by else "",
|
f"↻ <blue>@{reblogged_by.acct}</blue> boosted " if reblogged_by else "",
|
||||||
|
|
Loading…
Reference in a new issue