Remove problematic handling of multiple validation requests for same 3PID
This commit is contained in:
@@ -36,7 +36,6 @@ public class MappingManager {
|
|||||||
|
|
||||||
private Logger log = LoggerFactory.getLogger(MappingManager.class);
|
private Logger log = LoggerFactory.getLogger(MappingManager.class);
|
||||||
|
|
||||||
private Map<String, Session> threePidLookups = new WeakHashMap<>();
|
|
||||||
private Map<String, Session> sessions = new HashMap<>();
|
private Map<String, Session> sessions = new HashMap<>();
|
||||||
private Timer cleaner;
|
private Timer cleaner;
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ public class MappingManager {
|
|||||||
log.info("Session {} is obsolete, removing", s.sid);
|
log.info("Session {} is obsolete, removing", s.sid);
|
||||||
|
|
||||||
sessions.remove(s.sid);
|
sessions.remove(s.sid);
|
||||||
threePidLookups.remove(s.hash);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,16 +63,9 @@ public class MappingManager {
|
|||||||
} while (sessions.containsKey(sid));
|
} while (sessions.containsKey(sid));
|
||||||
|
|
||||||
String threePidHash = data.getMedium() + data.getValue();
|
String threePidHash = data.getMedium() + data.getValue();
|
||||||
Session session = threePidLookups.get(threePidHash);
|
// TODO think how to handle different requests for the same e-mail
|
||||||
if (session != null) {
|
Session session = new Session(sid, threePidHash, data);
|
||||||
sid = session.sid;
|
sessions.put(sid, session);
|
||||||
} else {
|
|
||||||
// TODO perform some kind of validation
|
|
||||||
|
|
||||||
session = new Session(sid, threePidHash, data);
|
|
||||||
sessions.put(sid, session);
|
|
||||||
threePidLookups.put(threePidHash, session);
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("Created new session {} to validate {} {}", sid, session.medium, session.address);
|
log.info("Created new session {} to validate {} {}", sid, session.medium, session.address);
|
||||||
return sid;
|
return sid;
|
||||||
|
|||||||
Reference in New Issue
Block a user