The Grand Ayatollah Khamenei answered a question about the condition for prohibition of using offensive language.
Question: Is it the condition for the prohibition of using offensive language that the addressee be present?
The Grand Ayatollah Khamenei: The presence of addressee is the condition for prohibition of using offensive language; whether the addressee is the same person being insulted or someone else. Therefore, if a person in private when there is no addressee, uses offensive language, it is not Haram (not prohibited).
source : shafaqna.com