Actually, not only should they not be at War with you, they shouldn't have a Close relationship with you it seems to me.
Trading with their enemies, trading with an infidel, concerned about your military buildup. Suddenly I'd be looking at my Close partner and gently asking WTF...
I think the values for those diplomatic situations are a bit out of whack ie trading with an enemy drops you down a level or two (I assume they asked you not to and you refused or you started trading with whoever that race is knowing they were enemies of the Alterian Resistance?)
And giving a (ie singular) gift in some situations shouldn't get you a nice green plus, just a "okay, we'll postpone the war for a week" response.