Skip to content

Commit

Permalink
Strip protocol part when doing 3PID invites for. Partially fixes elem…
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Dec 15, 2015
1 parent b906972 commit 5719d51
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1431,8 +1431,21 @@ MatrixClient.prototype.inviteByThreePid = function(roomId, medium, address, call
{ $roomId: roomId }
);

var identityServerUrl = this.getIdentityServerUrl();
if (!identityServerUrl) {
return q.reject(new MatrixError({
error: "No supplied identity server URL",
errcode: "ORG.MATRIX.JSSDK_MISSING_PARAM"
}));
}
if (identityServerUrl.indexOf("http://") === 0 ||
identityServerUrl.indexOf("https://") === 0) {
// this request must not have the protocol part because reasons
identityServerUrl = identityServerUrl.split("://")[1];
}

return this._http.authedRequest(callback, "POST", path, undefined, {
id_server: this.getIdentityServerUrl(),
id_server: identityServerUrl,
medium: medium,
address: address
});
Expand Down

0 comments on commit 5719d51

Please sign in to comment.