Skip to content

Commit

Permalink
Refs FedStoa#108 - Conditional posting by favourites
Browse files Browse the repository at this point in the history
  • Loading branch information
xurizaemon committed Mar 11, 2019
1 parent 1d72629 commit 4a65222
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions moa/toot.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def is_reply(self):
def is_self_reply(self):
return self.is_reply and self.data['in_reply_to_account_id'] == self.data['account']['id']

@property
def is_favourited(self):
return self.data['favourited']

@property
def is_boost(self):
return self.data['reblog'] is not None
Expand Down Expand Up @@ -146,6 +150,11 @@ def should_skip(self):
# If it's a boost and boosts are allowed then post it even
# if public toots aren't allowed
pass

elif self.settings.conditional_posting_faves and not self.is_favourited:
logger.info(f'Skipping: Not posting unfavourited toot')
pass

elif self.settings.conditional_posting:

for ht in self.data['tags']:
Expand Down

0 comments on commit 4a65222

Please sign in to comment.