mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 11:18:08 -06:00
Mastodon: Load mentions only if the notification contains a post
This commit is contained in:
parent
5749b4c8e3
commit
d01856f436
@ -7,6 +7,7 @@ We had to release a 2023.2.8 version of TWblue, which removes the API deprecatio
|
|||||||
* TWBlue should be able to display variables within templates (for example, now it is possible to send a template inside a post's text). Before, it was removing $variables so it was difficult to show how to edit templates from the client. ([#515](https://github.com/MCV-Software/TWBlue/issues/515))
|
* TWBlue should be able to display variables within templates (for example, now it is possible to send a template inside a post's text). Before, it was removing $variables so it was difficult to show how to edit templates from the client. ([#515](https://github.com/MCV-Software/TWBlue/issues/515))
|
||||||
* Mastodon:
|
* Mastodon:
|
||||||
* it is possible to add descriptions for all media available on Mastodon (audio, photos, video and Givs). ([#516](https://github.com/MCV-Software/TWBlue/issues/516))
|
* it is possible to add descriptions for all media available on Mastodon (audio, photos, video and Givs). ([#516](https://github.com/MCV-Software/TWBlue/issues/516))
|
||||||
|
* Fixed an error on mentions buffer that was making TWBlue unable to load posts if there were mentions from a blocked or deleted account.
|
||||||
|
|
||||||
## Changes on version 2023.2.6
|
## Changes on version 2023.2.6
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ class MentionsBuffer(BaseBuffer):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception("Error %s" % (str(e)))
|
log.exception("Error %s" % (str(e)))
|
||||||
return
|
return
|
||||||
|
# Attempt to remove items with no statuses attached to them as it might happen when blocked accounts have notifications.
|
||||||
|
items = [item for item in items if item.status != None]
|
||||||
number_of_items = self.session.order_buffer(self.name, items)
|
number_of_items = self.session.order_buffer(self.name, items)
|
||||||
log.debug("Number of items retrieved: %d" % (number_of_items,))
|
log.debug("Number of items retrieved: %d" % (number_of_items,))
|
||||||
self.put_items_on_list(number_of_items)
|
self.put_items_on_list(number_of_items)
|
||||||
@ -49,7 +51,8 @@ class MentionsBuffer(BaseBuffer):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.exception("Error %s" % (str(e)))
|
log.exception("Error %s" % (str(e)))
|
||||||
return
|
return
|
||||||
print(items)
|
# Attempt to remove items with no statuses attached to them as it might happen when blocked accounts have notifications.
|
||||||
|
items = [item for item in items if item.status != None]
|
||||||
items_db = self.session.db[self.name]
|
items_db = self.session.db[self.name]
|
||||||
for i in items:
|
for i in items:
|
||||||
if utils.find_item(i, self.session.db[self.name]) == None:
|
if utils.find_item(i, self.session.db[self.name]) == None:
|
||||||
|
Loading…
Reference in New Issue
Block a user