damus
damus copied to clipboard
add optional toggle to load remote images
Potential solution for https://github.com/damus-io/damus/issues/124 once toggled all images come from robohash instead of loading from remote profiles
Looks like if a profile update event comes in it will update self.picture and this was getting leveraged so needed to set the restrict condition to only reference robohash instead of picture ?? robohash
when swapping the setting any profiles that were immediately loaded on home view before toggling will still show with previous setting until you scroll down to get more profiles, but I believe this should be blocking anymore remote requests aside from robohash
Maybe we can have a picker with 3 or 4 options:
- Load all images (insecure) -> will load http and https images
- Load secured images -> will only load https images
- Load contact images -> will only load people in our contact list
- No external images -> will only load robot hash
We can simplify it with 3 options I think
Maybe we can have a picker with 3 or 4 options:
- Load all images (insecure) -> will load http and https images
- Load secured images -> will only load https images
- Load contact images -> will only load people in our contact list
- No external images -> will only load robot hash
We can simplify it with 3 options I think
yeh I think your load all images, load contacts only, and load no external would be good. http/https won’t matter as much if they are worried about ip logging. I’ll have to see if we have a way of determining relation of profile when this image url is set. Thanks.
Added three levels of choice:
- Everyone (default)
- Friends Only
- Restricted
Not following jb55:
After following:
Everyone else in feed I am not following from this dummy account:

@jb55 let me know if this is something we might be interested in for future or if you have any alternate suggestions, I just heard some people talking about it in forums so thought I would take a shot at it.
Working for me but "Restricted" should be more expressive for non tech people
Hey! I just made a PR to your PR branch: https://github.com/radixrat/damus/pull/1
It contains the working version with enum update :)
Hey! I just made a PR to your PR branch: radixrat#1
It contains the working version with enum update :)
nice, this is much cleaner, I merged it, thanks! What is your opinion on a better word for "Restricted"? would "Block All" give a better indication to end user?
In the code you merged, I changed by "Restricted (no remote image)"
Maybe "Block images" can be better
Another thing : If we're going to block profile images, we might block post images/gif as well So, all external contents
Another thing : If we're going to block profile images, we might block post images/gif as well So, all external contents
Yeh believe this could be expanded to cover all image cases, I know there is a block of code that currently restricts image loading to only friends should_show_images in EventView, I think this setting could be leveraged there.
One thing is I think we would want to have a friends of friends option in this case as well
Applied same policy to should_show_images we used for profile restrictions, so image loading should follow this setting now as well. One thing I think would be safer is to set the default to Friends of Friends instead of Everyone, the reason the code was initially put in place was to stop the porn bots so setting default to everyone would bring that issue back.
when set to everyone can view images:

When restricted it will block:

Agreed with the default to friends only
I think we can activate friends of friends but if we add this option, I think we need to keep the friend only option too And the option friends of friends can be time consuming to develop
Then maybe an improvement for a next time in another PR (or maybe someone can make it)
Agreed with the default to friends only
I think we can activate friends of friends but if we add this option, I think we need to keep the friend only option too And the option friends of friends can be time consuming to develop
Then maybe an improvement for a next time in another PR (or maybe someone can make it)
Friends of friends is already implemented in contacts module, I added it alongside friends so options now are:
- Everyone
- Friends Only
- Friend of Friends
- Block Images
Friends of Friends is current default.
think that should cover everything so far.
Can we invert friends and friends of friends in the list ?
Can we invert friends and friends of friends in the list ?
done. makes mores sense with this ordering less restrictive -> more restrictive
let remote_image_policy: RemoteImagePolicy = RemoteImagePolicy(rawValue: UserDefaults.standard.string(forKey: "remote_image_policy")!) ?? .friendsOfFriends
this can cause crash if optional string UserDefaults.standard.string(forKey: "remote_image_policy")! unwrapped is nil, added a fallback with coalesce, then the existing coalesce outside the brackets should be effective after that point when RemoteImagePolicy comes back nil
sorry this got left behind... haven't had a change to review this one yet and looks like it needs rebased
rebased to current upstream
Related - I'm actually working on a Core ML porn detector that uses AI to return a value between 0 and 1 for images, where 1 would be extreme content. In the settings you could turn AI detection on.
Oh!
Related - I'm actually working on a Core ML porn detector that uses AI to return a value between 0 and 1 for images, where 1 would be extreme content. In the settings you could turn AI detection on.
One issue is if it waits till it’s client side to detect, the image has already been retrieved so if you are at work or something it won’t save you from explaining why porn photos were downloaded 😂
I wonder if nostr has a way to mark nsfw at relay level so you never retrieve them. Then you can blame your friendosphere otherwise if they upload nsfw without marking it (or just have it set to never load images while at work)
Looks like out of date again I’ll try to rebase, think I need to factor in this new preview pane, if the goal is to not load the images at all from remote sources, I noticed it paints an outline before user clicks so think the image is getting loaded remotely anyways even if show images bool is false, before it would not load the image at all
Link would be downloaded but not the image itself until actually displayed or prefetched by the client.
On Mon, 9 Jan 2023 at 14:09, radixrat @.***> wrote:
Related - I'm actually working on a Core ML porn detector that uses AI to return a value between 0 and 1 for images, where 1 would be extreme content. In the settings you could turn AI detection on.
One issue is if it waits till it’s client side to detect, the image has already been retrieved so if you are at work or something it won’t save you from explaining why porn photos were downloaded 😂
— Reply to this email directly, view it on GitHub https://github.com/damus-io/damus/pull/127#issuecomment-1375679207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEWI45XPQEUG3HMJSUINE3WRQL3NANCNFSM6AAAAAATIAEIBY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Link would be downloaded but not the image itself until actually displayed or prefetched by the client. …
so the porn ML detection is based on url name instead of actual content of the image?
Link would be downloaded but not the image itself until actually displayed or prefetched by the client.
…
so the porn ML detection is based on url name instead of actual content of the image?
I haven't submitted the PR for that yet. I don't think it replaces these options, just an additional option (might put it under "experimental"). You pass the image into a method.
Link would be downloaded but not the image itself until actually displayed or prefetched by the client.
…
so the porn ML detection is based on url name instead of actual content of the image?
I haven't submitted the PR for that yet. I don't think it replaces these options, just an additional option (might put it under "experimental"). You pass the image into a method.
Yeh so this is a similar problem I am currently facing with the nice blurred preview pane (as opposed to old behaviour where it showed a link instead of blurred image), the image has to be client side before it can get a blurred version for the ImageCarousal, but by having the image client side to analyze it you've already loaded it from the remote source which means your work network sees you downloaded the porn content.
At least for the image carousal it would be better I think if we had a default image fallback if show images was toggled off @0xtlt not sure if you have any thoughts about this, for now I just left it with blurred preview pane as that is current default.
not sure what the state of this is, but ideally I would like to not load blurred images by default. right now they are downloaded and blurred which is not good