Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Following yourself in surf mode #215

Closed
DrEvilBrain opened this issue Apr 12, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@DrEvilBrain
Copy link
Contributor

commented Apr 12, 2016

It's possible to follow yourself by going into surf mode just by clicking the follow button. Minor issue but I guess it matters?

Example of myself following myself

@joppiesaus

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2016

This is a lot harder now, but still possible.
There is a function for this: Site.toggleFollow(siteId, csrfToken)
The crsfToken is included in the page. It's easy to get.
The siteId however... You need to figure out your site's ID. If you have another site or a friend's site this is quite easy; go to your site as the alternate site, inspect the "follow" button and you've got your siteId.
If you don't have this, you can figure it out by time. You can go to browse mode, sort by time(newest or oldest), and find your site. This is hard when you have a old site, but when you have a new one this is really easy. Find your site, go to it in surf mode. Go back one site, inspect the follow button, and see what id the site has. Write it down, go two sites further, and write that id down as well. If you're lucky, there's only one id in between that, that's your siteid. If not, you have to try them all. Now you can use the function, or in surf mode just toggleFollow(yoursiteid).
There are probably more ways but these are the obvious ways that I found out.
A fix would be to check on the server if the siteId is not the site who's trying to follow. Also, I'd doubt if people actually do this because it's so difficult(it's not an issue if it isn't a problem).

I also noticed (while trying this) that if you go further then one page in browse mode, and you try to surf the website, you end up at a different website then you clicked on. This is because the surf function doesn't take the amount of pages you are in browse mode into account. (i.e. if you are in the second page of browse mode and you click the second site, it goes to the second site of the search criteria and not the amount of the pages already traveled + the selected site). The correct amount would be: page * amountPerPage + siteOnPage. Or just set it properly server-side. (Do I need to open a separate issue for this?)

I have a lot of trouble trying to explain this to you over the internet, but I hope this helps. I am going to try and fix these issues and then pull-request the fixes. 💌

joppiesaus added a commit to joppiesaus/neocities that referenced this issue Aug 10, 2016

Fixes neocities#215
Unfollowing yourself is still possible, if it may cause problems in the
future. User does not get any info(i.e. "You cannot follow yourself"),
however.

@kyledrake kyledrake closed this in 4e74d04 Mar 4, 2017

kyledrake added a commit that referenced this issue Mar 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.