One way to get around this is to be very aware of your own feelings. If you're feeling positive and someone else isn't, you don't have to let that ruin your day. Be mindful of your feelings and try to redirect them if at all possible. A verse from Proverbs 15 says "A gentle answer turns away wrath, but a harsh word stirs up anger". Has there every been a truer statement? When we return harshness with harshness, things escalate quickly. When we strive to remain calm and respond kindly, often times it defuses the situation. Even if it doesn't, at least we haven't let ourselves be pulled into their orbit of anger.
Believe me when I say I have been guilty of letting myself get pulled into other people's emotions more than once. The last few months, I have been working at being more mindful of my own emotions. I am always a work in progress. :)