Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected void doStart() throws Exception {
}

if (endpoint.getRoom() == null) {
privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.getChatId()));
privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.resolveParticipant(connection)));
} else {
// add the presence packet listener to the connection so we only get packets that concerns us
// we must add the listener before creating the muc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ private XMPPTCPConnection createConnectionInternal() throws UnknownHostException
return new XMPPTCPConnection(conf);
}

/**
* If there is no "@" symbol in the participant, find the service domain
* JID and return the fully qualified JID for the participant as user@server.domain
*/
public String resolveParticipant(XMPPConnection connection) {
String participant = getParticipant();

if (participant.indexOf('@', 0) != -1) {
return participant;
}

return participant + "@" + connection.getXMPPServiceDomain().toString();
}

/*
* If there is no "@" symbol in the room, find the chat service JID and
* return fully qualified JID for the room as room@conference.server.domain
Expand Down