見人講人話，見鬼講鬼話

Proverb

 * 1)  to be flexible and know what to say in different situations and to different people;  to be crafty and two-faced