Treat others they way you would like to be treated
Treat others the way they treat you
'not to do to others as you would not wish done to yourself' (Analects 12.2)
Its kind of both, if others treat you a certain way than by a logic of the first quote they wish to be treated that way in return.
This is more logical. Now, you shouldn't always be like this, because if someone has a bad day, doesn't mean you go all feminist on them. But in general this.
People do not have the same heart as you, therefore you must teach them how you think and feel so if they do indeed have an opinion of you, you will know how they feel so you can make a judgement of how to handle that person's presence.
If someone treats me badly I will treat them badly. Vengeance is justice. Equally if someone treats me well I will treat them well.
What about treat others with respect, regardless? The "treat others the way you wish to be treated" seems to me to be wishful thinking. Let's suppose a persons does not have a home. Suppose also that person to be happily living outdoors, and sleeping on the ground. Now, would it make the person flinch, for instance, burning down someone else's home? I believe not, since the person happily lives without one, therefore cannot have the concept of treat others as s/he wishes they would treat him/her.