Fix #2
This commit is contained in:
pare
5bc8f95941
commit
bd84443c3e
S'han modificat 1 arxius amb 9 adicions i 30 eliminacions
39
corpus.py
39
corpus.py
|
@ -35,13 +35,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
for notif in notifications:
|
for notif in notifications:
|
||||||
|
|
||||||
if notif.type != 'mention' and notif.type != 'status':
|
if notif.type == 'mention':
|
||||||
|
|
||||||
print(f"Dismissing notification id {notif.id}")
|
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(notif.id)
|
|
||||||
|
|
||||||
elif notif.type == 'mention':
|
|
||||||
|
|
||||||
mention = bot.get_data(notif)
|
mention = bot.get_data(notif)
|
||||||
|
|
||||||
|
@ -149,38 +143,23 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
bot.mastodon.status_post(f'@{mention.acct}, error al esborrar tots els tuts.', in_reply_to_id=mention.status_id, visibility='direct')
|
bot.mastodon.status_post(f'@{mention.acct}, error al esborrar tots els tuts.', in_reply_to_id=mention.status_id, visibility='direct')
|
||||||
|
|
||||||
print(f"Dismissing notification id {mention.id}")
|
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(mention.id)
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
|
||||||
print(f"Dismissing notification id {mention.id}")
|
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(mention.id)
|
|
||||||
|
|
||||||
elif notif.type == 'status':
|
elif notif.type == 'status':
|
||||||
|
|
||||||
if 'visibility' in notif.status:
|
if notif.status != None:
|
||||||
|
|
||||||
if notif.status.visibility == 'public' and notif.status.language == 'ca':
|
if 'visibility' in notif.status:
|
||||||
|
|
||||||
found_it, pending = db.check_user(notif.account.acct)
|
if notif.status.visibility == 'public' and notif.status.language == 'ca':
|
||||||
|
|
||||||
if found_it and not pending and notif.status.in_reply_to_account_id == None:
|
found_it, pending = db.check_user(notif.account.acct)
|
||||||
|
|
||||||
is_saved = db.save_post(notif.account.acct, unescape(cleanhtml(notif.status.content)))
|
if found_it and not pending and notif.status.in_reply_to_account_id == None:
|
||||||
|
|
||||||
print(f"Dismissing notification id {notif.id}")
|
is_saved = db.save_post(notif.account.acct, unescape(cleanhtml(notif.status.content)))
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(notif.id)
|
print(f"Dismissing notification id {notif.id}")
|
||||||
|
|
||||||
else:
|
bot.mastodon.notifications_dismiss(notif.id)
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(notif.id)
|
|
||||||
else:
|
|
||||||
|
|
||||||
bot.mastodon.notifications_dismiss(notif.id)
|
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència