Fix /sync may contain duplicate EDUs and EDUs for left rooms (#752)
Fix /sync may contain duplicate EDUs and EDUs for left rooms (#752)

In 29841be (#718), EDUs are added to /sync responses for rooms listed
in joinedRoomIDs returned by addPDUDeltaToResponse. However this list
may contain rooms other than those currently joined.

Some variable renamings are done to make golangci-lint pass.

Signed-off-by: 1b854f9f346710159177cc1c18ee9239bcf2b613@gmail.com
matrix-org/dendrite,matrix-org/dendrite,matrix-org/dendrite,matrix-org/dendrite