MCPcopy Create free account
hub / github.com/daodst/chat / IsServerBannedFromRoom

Function IsServerBannedFromRoom

roomserver/api/wrapper.go:132–143  ·  view source on GitHub ↗

IsServerBannedFromRoom returns whether the server is banned from a room by server ACLs.

(ctx context.Context, rsAPI FederationRoomserverAPI, roomID string, serverName gomatrixserverlib.ServerName)

Source from the content-addressed store, hash-verified

130
131// IsServerBannedFromRoom returns whether the server is banned from a room by server ACLs.
132func IsServerBannedFromRoom(ctx context.Context, rsAPI FederationRoomserverAPI, roomID string, serverName gomatrixserverlib.ServerName) bool {
133 req := &QueryServerBannedFromRoomRequest{
134 ServerName: serverName,
135 RoomID: roomID,
136 }
137 res := &QueryServerBannedFromRoomResponse{}
138 if err := rsAPI.QueryServerBannedFromRoom(ctx, req, res); err != nil {
139 util.GetLogger(ctx).WithError(err).Error("Failed to QueryServerBannedFromRoom")
140 return true
141 }
142 return res.Banned
143}
144
145// PopulatePublicRooms extracts PublicRoom information for all the provided room IDs. The IDs are not checked to see if they are visible in the
146// published room directory.

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.45

Tested by

no test coverage detected