Electronic-harassment/intrusive-thoughts are a bane that many people, over time, experience.
Stay off stimulants such as caffeine/amphetamines and drugs like marijuana/alcohol, is my advice.
The largest ever study of the effects of the main psychoactive component of cannabis suggests that it can cause paranoia in vulnerable individuals
www.psychologytoday.com
And yes, thoughts of violence can also be attributed to intrusive thoughts.
The "trick" in managing these influences is emotional stability.
Just my opinion based on personal experience.