It's not actually that bad.
First, even in your version, the "feel goods" (high salaries) and the "complainers" (low salaries) would cancel each other out, and (assuming equal numbers of them) will give us a usable median value.
But in the real world is more complicated than "self-selection" in the basic mode you describe.
Who might "feel good" and who might feel "justified in complaining" will not be so much based on the salary, but more on the person and their personality (which we can assume are evenly distributed among salaries).
In other words, it won't only be actually great salaries that are reported from people "feeling good", nor only low salaries reported from people "justified in complaining". And then you'll also have people that regardless if they consider their salary high or low, they want transparency etc, and report their salaries.
The end median result, given enough samples, would be a useful, if not 100% accurate, representation of the situation.