Don’t add MUCs to the roster when receiving a private message when we aren’t present
The private message should include a <{muc}x/> element, which you can use to know if it’s from a MUC.
Alternatively, doing a disco#info should give this information.