Negativity is contagious. Having a difficult person to deal with at work or at school can bring you down. The oozing negativities from mean people can sometimes spill into others, transferring the negative energy and perpetuating an ugly workplace or a stressful environment. It may seem natural that a person saturated in a nasty environment may become rude too, but it doesn't have to be that way.
Humans can break free from cause and effect. You can set yourself free from being influenced by irate people. Say to yourself, "I am because I am, and not because of you", its a mantra I am willing to share in order to stop the spread of the "mean-ness disease". If you know yourself to be a naturally lively person and you're starting to become unfriendly too because of constant contact with rude people, then tell yourself that you have a choice on how to be. To be is exactly how you are apart from the ugly influence of nasty people. You can still be nice. Its not easy though, and a lot of hard work and patience is required to break free from the patterns of this world. Life is what we make it, and not what others do.