I am trying to do file transfers to another user, but to do that, I need the fully qualified jabber id of that user. Right now I can get the node and domain only for the user I select but not the “resource.” How do I get this?
I think it has something to do with subscribing to a user’s presence to get his resource. I tried this to subscribe to a buddy’s presence:
Presence sub = new Presence(Presence.Type.subscribe);
Roster m = conn.getRoster();
Presence g= m.getPresenceResource(“user123@domain”);
And it prints out unavailable (it is supposed to print the user123’s resource if I am subscribed to his presence updates and unavailable if i am not subsrcibed). user123 is a buddy in my roster.