Retrieving resource from active conversation

Forgive me if this is in the docs anywhere, try as I might, I couldn’t find anything. Simple[ish] question. I am forcing my users to use hostname as a resource. Is it possible to retrieve that from their client? I am trying to write a plugin to spawn a vnc session from the chat window, but I need to know what the hostname is. Any thoughts?

Thanks in advance!

I can’t point you to a direct place, but your client gets the sender’s resource with a first received message in that login session. You can see it in the history window (titlebar). If you open it without any messages in this session, you will see only “Conversation history for user@server”. But if you open it after receiving a message from that user, you will see “Conversation history for user@server/resource”.

Ok, so going off of that I concluded that the resource was indeed retrievable, and found this function in UserManager.java

/**
     * Returns the full jid (with resource) based on the user's jid.
     *
     * @param jid the users bare jid.
     * @return the full jid with resource.
     */
    public String getFullJID(String jid) {
        Presence presence = PresenceManager.getPresence(jid);
        return presence.getFrom();
    }

So I can roll that into my plugin and parse the resource out of the JID.

Thanks for the nudge