Can't parse JID with resource being a space
/disco "foo@bar/ " (note the space), yields the following error:
Invalid JID “"foo@bar/ "”: JID could not be parsed
This JID is valid when not in MUC, (from 0045):
In addition, a MUC service MUST NOT allow empty or invisible Room Nicknames (i.e., Room Nicknames that consist only of one or more space characters).
I assume this is also the cause of my contact not appearing as online.