Más hilos

This commit is contained in:
Jesús Pavón Abián
2026-02-01 13:08:35 +01:00
parent 3e239f05c8
commit fdcc77989e
2 changed files with 120 additions and 11 deletions

View File

@@ -52,11 +52,59 @@ class FollowersBuffer(UserBuffer):
kwargs["api_method"] = "get_followers"
super(FollowersBuffer, self).__init__(*args, **kwargs)
def remove_buffer(self, force=False):
if not force:
from wxUI import commonMessageDialogs
import widgetUtils
dlg = commonMessageDialogs.remove_buffer()
if dlg != widgetUtils.YES:
return False
try:
self.session.db.pop(self.name, None)
except Exception:
pass
try:
key = self.kwargs.get("handle") or self.kwargs.get("actor") or self.kwargs.get("id")
timelines = self.session.settings["other_buffers"].get("followers_timelines") or []
if isinstance(timelines, str):
timelines = [t for t in timelines.split(",") if t]
if key in timelines:
timelines.remove(key)
self.session.settings["other_buffers"]["followers_timelines"] = timelines
self.session.settings.write()
except Exception:
log.exception("Error updating Bluesky followers timelines settings")
return True
class FollowingBuffer(UserBuffer):
def __init__(self, *args, **kwargs):
kwargs["api_method"] = "get_follows"
super(FollowingBuffer, self).__init__(*args, **kwargs)
def remove_buffer(self, force=False):
if not force:
from wxUI import commonMessageDialogs
import widgetUtils
dlg = commonMessageDialogs.remove_buffer()
if dlg != widgetUtils.YES:
return False
try:
self.session.db.pop(self.name, None)
except Exception:
pass
try:
key = self.kwargs.get("handle") or self.kwargs.get("actor") or self.kwargs.get("id")
timelines = self.session.settings["other_buffers"].get("following_timelines") or []
if isinstance(timelines, str):
timelines = [t for t in timelines.split(",") if t]
if key in timelines:
timelines.remove(key)
self.session.settings["other_buffers"]["following_timelines"] = timelines
self.session.settings.write()
except Exception:
log.exception("Error updating Bluesky following timelines settings")
return True
class BlocksBuffer(UserBuffer):
def __init__(self, *args, **kwargs):
kwargs["api_method"] = "get_blocks"