Skip to content

Commit

Permalink
Remove unused but bug-triggering code block (Fix #172)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxidorius committed May 4, 2019
1 parent 25968e0 commit 8243354
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.kamax.matrix._ThreePid;
import io.kamax.matrix.client.as.MatrixApplicationServiceClient;
import io.kamax.matrix.event.EventKey;
import io.kamax.matrix.hs._MatrixRoom;
import io.kamax.mxisd.Mxisd;
import io.kamax.mxisd.backend.sql.synapse.Synapse;
import io.kamax.mxisd.config.MxisdConfig;
Expand Down Expand Up @@ -81,15 +80,14 @@ public void process(JsonObject ev, _MatrixID sender, String roomId) {

_MatrixID target = MatrixID.asAcceptable(targetId);
if (!StringUtils.equals(target.getDomain(), cfg.getMatrix().getDomain())) {
log.debug("Ignoring invite for {}: not a local user");
log.debug("Ignoring invite for {}: not a local user", targetId);
return;
}

log.info("Got membership event from {} to {} for room {}", sender.getId(), targetId, roomId);

boolean isForMainUser = StringUtils.equals(target.getLocalPart(), cfg.getAppsvc().getUser().getMain());
boolean isForExpInvUser = StringUtils.equals(target.getLocalPart(), cfg.getAppsvc().getUser().getInviteExpired());
boolean isUs = isForMainUser || isForExpInvUser;

if (StringUtils.equals("join", EventKey.Membership.getStringOrNull(content))) {
if (!isForMainUser) {
Expand All @@ -108,10 +106,7 @@ public void process(JsonObject ev, _MatrixID sender, String roomId) {
processForUserIdInvite(roomId, sender, target);
}
} else if (StringUtils.equals("leave", EventKey.Membership.getStringOrNull(content))) {
_MatrixRoom room = client.getRoom(roomId);
if (!isUs && room.getJoinedUsers().size() == 1) {
// TODO we need to find out if this is only us remaining and leave the room if so, using the right client for it
}
// TODO we need to find out if this is only us remaining and leave the room if so, using the right client for it
} else {
log.debug("This is not an supported type of membership event, skipping");
}
Expand Down

0 comments on commit 8243354

Please # to comment.