Correctly handle 3PID notification revamping (forgotten code)
This commit is contained in:
@@ -115,28 +115,6 @@ public class EmailSendGridConfig {
|
||||
|
||||
public static class Templates {
|
||||
|
||||
public static class TemplateSessionValidation {
|
||||
|
||||
private EmailTemplate local = new EmailTemplate();
|
||||
private EmailTemplate remote = new EmailTemplate();
|
||||
|
||||
public EmailTemplate getLocal() {
|
||||
return local;
|
||||
}
|
||||
|
||||
public void setLocal(EmailTemplate local) {
|
||||
this.local = local;
|
||||
}
|
||||
|
||||
public EmailTemplate getRemote() {
|
||||
return remote;
|
||||
}
|
||||
|
||||
public void setRemote(EmailTemplate remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TemplateSessionUnbind {
|
||||
|
||||
private EmailTemplate fraudulent = new EmailTemplate();
|
||||
@@ -153,14 +131,14 @@ public class EmailSendGridConfig {
|
||||
|
||||
public static class TemplateSession {
|
||||
|
||||
private TemplateSessionValidation validation = new TemplateSessionValidation();
|
||||
private EmailTemplate validation = new EmailTemplate();
|
||||
private TemplateSessionUnbind unbind = new TemplateSessionUnbind();
|
||||
|
||||
public TemplateSessionValidation getValidation() {
|
||||
public EmailTemplate getValidation() {
|
||||
return validation;
|
||||
}
|
||||
|
||||
public void setValidation(TemplateSessionValidation validation) {
|
||||
public void setValidation(EmailTemplate validation) {
|
||||
this.validation = validation;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ public class EmailTemplateConfig extends GenericTemplateConfig {
|
||||
public EmailTemplateConfig() {
|
||||
setInvite("classpath:/threepids/email/invite-template.eml");
|
||||
getGeneric().put("matrixId", "classpath:/threepids/email/mxid-template.eml");
|
||||
getSession().getValidation().setLocal("classpath:/threepids/email/validate-local-template.eml");
|
||||
getSession().getValidation().setRemote("classpath:/threepids/email/validate-remote-template.eml");
|
||||
getSession().setValidation("classpath:/threepids/email/validate-template.eml");
|
||||
getSession().getUnbind().setFraudulent("classpath:/threepids/email/unbind-fraudulent.eml");
|
||||
}
|
||||
|
||||
public EmailTemplateConfig build() {
|
||||
log.info("--- E-mail Generator templates config ---");
|
||||
log.info("Invite: {}", getName(getInvite()));
|
||||
log.info("Session validation:");
|
||||
log.info("\tLocal: {}", getName(getSession().getValidation().getLocal()));
|
||||
log.info("\tRemote: {}", getName(getSession().getValidation().getRemote()));
|
||||
log.info("Session:");
|
||||
log.info("\tValidation: {}", getSession().getValidation());
|
||||
log.info("\tUnbind:");
|
||||
log.info("\t\tFraudulent: {}", getSession().getUnbind().getFraudulent());
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -39,29 +39,6 @@ public class GenericTemplateConfig {
|
||||
|
||||
public static class Session {
|
||||
|
||||
public static class SessionValidation {
|
||||
|
||||
private String local;
|
||||
private String remote;
|
||||
|
||||
public String getLocal() {
|
||||
return local;
|
||||
}
|
||||
|
||||
public void setLocal(String local) {
|
||||
this.local = local;
|
||||
}
|
||||
|
||||
public String getRemote() {
|
||||
return remote;
|
||||
}
|
||||
|
||||
public void setRemote(String remote) {
|
||||
this.remote = remote;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class SessionUnbind {
|
||||
|
||||
private String fraudulent;
|
||||
@@ -76,14 +53,14 @@ public class GenericTemplateConfig {
|
||||
|
||||
}
|
||||
|
||||
private SessionValidation validation = new SessionValidation();
|
||||
private String validation;
|
||||
private SessionUnbind unbind = new SessionUnbind();
|
||||
|
||||
public SessionValidation getValidation() {
|
||||
public String getValidation() {
|
||||
return validation;
|
||||
}
|
||||
|
||||
public void setValidation(SessionValidation validation) {
|
||||
public void setValidation(String validation) {
|
||||
this.validation = validation;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,18 +29,17 @@ public class PhoneSmsTemplateConfig extends GenericTemplateConfig {
|
||||
|
||||
public PhoneSmsTemplateConfig() {
|
||||
setInvite("classpath:/threepids/sms/invite-template.txt");
|
||||
getGeneric().put("matrixId", "classpath:/threepids/email/mxid-template.eml");
|
||||
getSession().getValidation().setLocal("classpath:/threepids/sms/validate-local-template.txt");
|
||||
getSession().getValidation().setRemote("classpath:/threepids/sms/validate-remote-template.txt");
|
||||
getSession().setValidation("classpath:/threepids/sms/validate-template.txt");
|
||||
getSession().getUnbind().setFraudulent("classpath:/threepids/sms/unbind-fraudulent.txt");
|
||||
}
|
||||
|
||||
public PhoneSmsTemplateConfig build() {
|
||||
log.info("--- SMS Generator templates config ---");
|
||||
log.info("Invite: {}", getName(getInvite()));
|
||||
log.info("Session validation:");
|
||||
log.info("\tLocal: {}", getName(getSession().getValidation().getLocal()));
|
||||
log.info("\tRemote: {}", getName(getSession().getValidation().getRemote()));
|
||||
log.info("Session:");
|
||||
log.info("\tValidation: {}", getSession().getValidation());
|
||||
log.info("\tUnbind:");
|
||||
log.info("\t\tFraudulent: {}", getSession().getUnbind().getFraudulent());
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user