Respect 3PID session policy for remote sending with phone numbers

This commit is contained in:
Maxime Dor
2018-03-02 23:27:19 +01:00
parent cb3130d365
commit ea08a80504
2 changed files with 39 additions and 1 deletions

View File

@@ -196,7 +196,7 @@ public class SessionMananger {
storage.updateThreePidSession(session.getDao());
log.info("Session {} has been validated locally", session.getId());
if (ThreePidMedium.PhoneNumber.is(session.getThreePid().getMedium()) && session.isValidated()) {
if (ThreePidMedium.PhoneNumber.is(session.getThreePid().getMedium()) && session.isValidated() && policy.toRemote()) {
createRemote(sid, secret);
// FIXME make the message configurable/customizable (templates?)
throw new MessageForClientException("You will receive a NEW code from another number. Enter it below");