mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 06:53:09 -06:00
Allow invited users to fetch state events and events by ID (#17)
* Allow invited users to fetch state events and events by ID * Move failing test case to blacklist * Fix /sync panicking due to presence udpates * Use upload-artifact v3 * Yet another attempt to fix sytest artefacts * Maybe this will work?
This commit is contained in:
parent
ac556d93d4
commit
507d3dc650
5
.github/workflows/dendrite.yml
vendored
5
.github/workflows/dendrite.yml
vendored
|
|
@ -191,13 +191,12 @@ jobs:
|
||||||
run: /src/are-we-synapse-yet.py /logs/results.tap -v
|
run: /src/are-we-synapse-yet.py /logs/results.tap -v
|
||||||
continue-on-error: true # not fatal
|
continue-on-error: true # not fatal
|
||||||
- name: Upload Sytest logs
|
- name: Upload Sytest logs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: Sytest Logs - ${{ job.status }} - (Dendrite, ${{ join(matrix.*, ', ') }})
|
name: Sytest Logs - ${{ job.status }} - (Dendrite, ${{ join(matrix.*, ', ') }})
|
||||||
path: |
|
path: |
|
||||||
/logs/results.tap
|
/logs
|
||||||
/logs/**/*.log*
|
|
||||||
|
|
||||||
# run Complement
|
# run Complement
|
||||||
complement:
|
complement:
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ func GetEvent(
|
||||||
util.GetLogger(req.Context()).WithError(err).Error("stateEvent.Membership failed")
|
util.GetLogger(req.Context()).WithError(err).Error("stateEvent.Membership failed")
|
||||||
return jsonerror.InternalServerError()
|
return jsonerror.InternalServerError()
|
||||||
}
|
}
|
||||||
if membership == gomatrixserverlib.Join {
|
if membership == gomatrixserverlib.Join || membership == gomatrixserverlib.Invite {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
JSON: gomatrixserverlib.ToClientEvent(r.requestedEvent, gomatrixserverlib.FormatAll),
|
JSON: gomatrixserverlib.ToClientEvent(r.requestedEvent, gomatrixserverlib.FormatAll),
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ func OnIncomingStateRequest(ctx context.Context, device *userapi.Device, rsAPI a
|
||||||
}
|
}
|
||||||
// If the user has never been in the room then stop at this point.
|
// If the user has never been in the room then stop at this point.
|
||||||
// We won't tell the user about a room they have never joined.
|
// We won't tell the user about a room they have never joined.
|
||||||
if !membershipRes.HasBeenInRoom {
|
if !membershipRes.HasBeenInRoom && membershipRes.Membership != gomatrixserverlib.Invite {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
JSON: jsonerror.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)),
|
JSON: jsonerror.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)),
|
||||||
|
|
@ -241,7 +241,7 @@ func OnIncomingStateTypeRequest(
|
||||||
}
|
}
|
||||||
// If the user has never been in the room then stop at this point.
|
// If the user has never been in the room then stop at this point.
|
||||||
// We won't tell the user about a room they have never joined.
|
// We won't tell the user about a room they have never joined.
|
||||||
if !membershipRes.HasBeenInRoom || membershipRes.Membership == gomatrixserverlib.Ban {
|
if !membershipRes.HasBeenInRoom && membershipRes.Membership != gomatrixserverlib.Invite || membershipRes.Membership == gomatrixserverlib.Ban {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusForbidden,
|
Code: http.StatusForbidden,
|
||||||
JSON: jsonerror.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)),
|
JSON: jsonerror.Forbidden(fmt.Sprintf("Unknown room %q or user %q has never joined this room", roomID, device.UserID)),
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ func (rp *RequestPool) updatePresence(db storage.Presence, presence string, user
|
||||||
existingPresence, ok := rp.Presence.LoadOrStore(userID, newPresence)
|
existingPresence, ok := rp.Presence.LoadOrStore(userID, newPresence)
|
||||||
if ok {
|
if ok {
|
||||||
p := existingPresence.(types.PresenceInternal)
|
p := existingPresence.(types.PresenceInternal)
|
||||||
if p.ClientFields.Presence == newPresence.ClientFields.Presence && newPresence.LastActiveTS-dbPresence.LastActiveTS < types.PresenceNoOpMs {
|
if dbPresence != nil && p.Presence == newPresence.Presence && newPresence.LastActiveTS-dbPresence.LastActiveTS < types.PresenceNoOpMs {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if dbPresence.Presence == types.PresenceOnline && presenceID == types.PresenceOnline && newPresence.LastActiveTS-dbPresence.LastActiveTS >= types.PresenceNoOpMs {
|
if dbPresence.Presence == types.PresenceOnline && presenceID == types.PresenceOnline && newPresence.LastActiveTS-dbPresence.LastActiveTS >= types.PresenceNoOpMs {
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,7 @@ Notifications can be viewed with GET /notifications
|
||||||
|
|
||||||
If remote user leaves room we no longer receive device updates
|
If remote user leaves room we no longer receive device updates
|
||||||
Guest users can join guest_access rooms
|
Guest users can join guest_access rooms
|
||||||
|
|
||||||
|
# For notifications extension on iOS
|
||||||
|
|
||||||
|
/event/ does not allow access to events before the user joined
|
||||||
|
|
@ -207,7 +207,6 @@ Deleted tags appear in an incremental v2 /sync
|
||||||
/event/ on non world readable room does not work
|
/event/ on non world readable room does not work
|
||||||
Outbound federation can query profile data
|
Outbound federation can query profile data
|
||||||
/event/ on joined room works
|
/event/ on joined room works
|
||||||
/event/ does not allow access to events before the user joined
|
|
||||||
Federation key API allows unsigned requests for keys
|
Federation key API allows unsigned requests for keys
|
||||||
GET /publicRooms lists rooms
|
GET /publicRooms lists rooms
|
||||||
GET /publicRooms includes avatar URLs
|
GET /publicRooms includes avatar URLs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue