@[email protected] Hey!
This is an upcoming feature, it's not documented yet because I might make breaking changes before it gets "stable".
If you want to try it anyway, yes you can create a file at data/stream.py
, and here is an example:
from loguru import logger
from app.customization import ObjectInfo
from app.customization import default_stream_visibility_callback
def custom_stream_visibility_callback(object_info: ObjectInfo) -> bool:
logger.info("Custom")
if object_info.actor_handle == "@[email protected]":
if "#microblogpub" in object_info.hashtags:
return True
return False
return default_stream_visibility_callback(object_info)
(but check for breaking changes when you update)
@[email protected] it does not support filtering announce yet, that is one of the upcoming breaking changes. Right now the function is not called at all.
I will try to remember pinging you when I pushed an update.
In the meantime, by going to the actor "profile", you can hide all the boosts for a given actor with the "hide shares" button.
Hey, @[email protected]. I was trying to find a way to customize what showed up in the Stream for microblog, when I found this code:
It looks like there is supposed to be a way to customize it by writing this
custom_stream_visibility_callback
.I think what I'm supposed to do is create a file at
data/stream.py
, and basically put the function in there, modeling it after thedefault_stream_visibility_callback
inapp/customization.py
.Am I understanding that correctly? I couldn't find any mention of this in the docs.