Skip to content

Commit

Permalink
Allow stanzas from bare JIDs if peer is full JID (most simple impleme…
Browse files Browse the repository at this point in the history
…ntation, for better one please see discussion here: otalk#20 and this PR otalk#21
  • Loading branch information
Konrad Kierus committed Feb 20, 2018
1 parent 4a5bd8c commit c49a5e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ SessionManager.prototype.process = function (req) {
});
}

// Check if the sender is a more specific peer Id (i.e., full jid vs bare jid)
if (session.peerID.indexOf(sender) === 0 && session.peerID !== sender) {
session.peerID = sender;
}

// Check if someone is trying to hijack a session.
if (session.peerID !== sender || session.ended) {
this._log('error', 'Session has ended, or action has wrong sender');
Expand Down

0 comments on commit c49a5e1

Please sign in to comment.