A wise old man was sitting at the river bank when he saw a cat that had fallen into the water, flailing around, trying to save itself from drowning.
The man decided to save the cat. He stretched his hand out but was scratched by the cat. He pulled his hand back in pain.
However, a minute later he stretched his hand out again to save the cat, but it scratched him again, and again he pulled his hand back in pain.
Another minute later he was yet again trying for the third time!!
A man, who was nearby watching what was happening, yelled out: "O wise man, you have not learned your lesson the first time, nor the second time, and now you are trying to save the cat a third time?"
The wise man paid no heed to that man's scolding, and kept on trying until he managed to save the cat.
He then walked over to the man, and patted his shoulder saying: "My son.. it is in the cat's nature to scratch, and it is in my nature to love and have sympathy. Why do you want me to let the cat's nature overcome mine !?!!
My son: Treat people according to your nature, not according to theirs, no matter what they are like and no matter how numerous are their actions that harm you and cause you hurt sometimes.
And do not pay heed to all the voices that loudly call out to you to leave behind your good qualities merely because the other party is not deserving of your noble actions.
When you live to give happiness to others, Allah Ta'ala will send you those who will live to give happiness to you.
"Is the reward for good anything but good?" -55:60
Be beautiful in character and hearts will love you.
So never regret the moments you gave happiness to someone, even if that person did not deserve it.
And suffice in the fact that you have a Lord Who will reward you for good with good.