super().__init__(client, "notifications", {"types[]":['mention']},
get=lambda item: item['status'])
+class UserStatusesFeed(IncrementalServerFeed):
+ def __init__(self, client, account_id):
+ super().__init__(client, f"accounts/{account_id}/statuses", {})
+
class ThreadFeed(Feed):
def __init__(self, client, post_id, full):
super().__init__(client)
sl.keys.append(('S', 'Send'))
# FIXME: for when we can auto-shrink bottom line
# sl.keys.append(('E', 'Examine'))
+ if isinstance(self, UserInfoFile):
+ sl.keys.append(('P', 'Posts'))
if self.items_are_statuses:
sl.keys.append(('F', 'Fave'))
sl.keys.append(('^B', 'Boost'))
account = cc.get("accounts/" + account_id)
return cls(cc, account)
+ def handle_key(self, ch):
+ if self.mode == 'normal' and ch in {'p', 'P'}:
+ feed = client.UserStatusesFeed(self.cc, self.account['id'])
+ name = self.cc.fq(self.account['acct'])
+ title = text.ColouredString(f"Posts from user {name}", 'H')
+ self.chain_to(StatusFile(self.cc, feed, title))
+
class EditorCommon:
# Common editing operations between the post editor and the line editor.
# Expects self.text to be the editor buffer, and self.point to be