First we need to state, yet again, that virtual particles don't exist. The way we calculate particle interactions is using perturbation theory, and for each term in the perturbative expansion we need to integrate an equation called the propagator. The Feynman diagrams are graphical representations of the equation for the propagator and do not show actual particles. The virtual particles shown in the diagrams are an artefact of the perturbative expansion.
With that out of the way, when we do the calculation the spin of the virtual particle that we are using in the calculation determines whether the interaction energy is negative or positive. With a zero or spin two particle the interaction energy for like charges is negative and the interaction energy for opposite charges is positive, so like charges attract and unlike charges repel. For a spin one virtual particle the opposite is true so like charges repel and unlike charges attract.
Photons have spin one, so like electrical charges repel and opposite electrical charges attract.
Gravitons have spin two so like charges attract, hence masses gravitationally attract each other. If negative masses existed (and we are fairly sure they don't) then a positive and negative mass would repel each other.
I think what you are asking is whether the virtual photons are different in the Feynman diagrams for like and unlike electrical charges interacting, but this is a meaningless question as virtual photons don't exist. When we calculate the propagator represented by the diagram of the virtual photon it has a different sign in the two cases.
If you're feeling brave the stuff I've outlined above is described in more detail in the answers to Why do same/opposite electric charges repel/attract each other, respectively? and How does one show using QED that same/opposite electric charges repel/attract each other, respectively?.