Search in sources :

Example 6 with MatrixID

use of io.kamax.matrix.MatrixID in project mxisd by kamax-io.

the class InvitationController method store.

@RequestMapping(value = "/store-invite", method = POST)
String store(HttpServletRequest request, @RequestParam String sender, @RequestParam String medium, @RequestParam String address, @RequestParam("room_id") String roomId) {
    Map<String, String> parameters = new HashMap<>();
    for (String key : request.getParameterMap().keySet()) {
        parameters.put(key, request.getParameter(key));
    }
    IThreePidInvite invite = new ThreePidInvite(new MatrixID(sender), medium, address, roomId, parameters);
    IThreePidInviteReply reply = mgr.storeInvite(invite);
    return gson.toJson(new ThreePidInviteReplyIO(reply, keyMgr.getPublicKeyBase64(keyMgr.getCurrentIndex()), srvCfg.getPublicUrl()));
}
Also used : ThreePidInvite(io.kamax.mxisd.invitation.ThreePidInvite) IThreePidInvite(io.kamax.mxisd.invitation.IThreePidInvite) HashMap(java.util.HashMap) ThreePidInviteReplyIO(io.kamax.mxisd.controller.identity.v1.io.ThreePidInviteReplyIO) IThreePidInvite(io.kamax.mxisd.invitation.IThreePidInvite) IThreePidInviteReply(io.kamax.mxisd.invitation.IThreePidInviteReply) MatrixID(io.kamax.matrix.MatrixID) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MatrixID (io.kamax.matrix.MatrixID)6 UserDirectorySearchResult (io.kamax.mxisd.controller.directory.v1.io.UserDirectorySearchResult)3 IOException (java.io.IOException)2 Test (org.junit.Test)2 Gson (com.google.gson.Gson)1 io.kamax.matrix._MatrixID (io.kamax.matrix._MatrixID)1 ThreePidInviteReplyIO (io.kamax.mxisd.controller.identity.v1.io.ThreePidInviteReplyIO)1 BadRequestException (io.kamax.mxisd.exception.BadRequestException)1 InternalServerError (io.kamax.mxisd.exception.InternalServerError)1 MappingAlreadyExistsException (io.kamax.mxisd.exception.MappingAlreadyExistsException)1 IThreePidInvite (io.kamax.mxisd.invitation.IThreePidInvite)1 IThreePidInviteReply (io.kamax.mxisd.invitation.IThreePidInviteReply)1 ThreePidInvite (io.kamax.mxisd.invitation.ThreePidInvite)1 ThreePidInviteIO (io.kamax.mxisd.storage.ormlite.ThreePidInviteIO)1 IThreePidSession (io.kamax.mxisd.threepid.session.IThreePidSession)1 ThreePidSession (io.kamax.mxisd.threepid.session.ThreePidSession)1 MalformedURLException (java.net.MalformedURLException)1 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1