Notification for proxying 3PID, remote 3PID are proxied by default

This commit is contained in:
Maxime Dor
2017-09-22 00:00:25 +02:00
parent a4b4a3f24c
commit 58d80b8eb3
4 changed files with 109 additions and 8 deletions

View File

@@ -137,15 +137,18 @@ public class EmailNotificationGenerator implements IEmailNotificationGenerator {
@Override
public String getForRemoteValidation(IThreePidSession session) {
log.info("Generating notification content for 3PID Session validation");
String templateBody = getTemplateAndPopulate(templateCfg.getSession().getValidation().getLocal(), session.getThreePid());
log.info("Generating notification content for remote-only 3PID session");
String templateBody = getTemplateAndPopulate(templateCfg.getSession().getValidation().getRemote(), session.getThreePid());
// FIXME should have a global link builder, specific to mxisd
String nextStepLink = srvCfg.getPublicUrl() + RemoteIdentityAPIv1.BASE +
"/validate/requestToken?sid=" + session.getId() + "&client_secret=" + session.getSecret();
"/validate/requestToken?sid=" + session.getId() +
"&client_secret=" + session.getSecret() +
"&token=" + session.getToken();
templateBody = templateBody.replace("%SESSION_ID%", session.getId());
templateBody = templateBody.replace("%SESSION_SECRET%", session.getSecret());
templateBody = templateBody.replace("%SESSION_TOKEN%", session.getToken());
templateBody = templateBody.replace("%NEXT_STEP_LINK%", nextStepLink);
return templateBody;