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

Method PerformDirectoryLookup

federationapi/internal/perform.go:21–39  ·  view source on GitHub ↗

PerformLeaveRequest implements api.FederationInternalAPI

(
	ctx context.Context,
	request *api.PerformDirectoryLookupRequest,
	response *api.PerformDirectoryLookupResponse,
)

Source from the content-addressed store, hash-verified

19
20// PerformLeaveRequest implements api.FederationInternalAPI
21func (r *FederationInternalAPI) PerformDirectoryLookup(
22 ctx context.Context,
23 request *api.PerformDirectoryLookupRequest,
24 response *api.PerformDirectoryLookupResponse,
25) (err error) {
26 dir, err := r.federation.LookupRoomAlias(
27 ctx,
28 request.ServerName,
29 request.RoomAlias,
30 )
31 if err != nil {
32 r.statistics.ForServer(request.ServerName).Failure()
33 return err
34 }
35 response.RoomID = dir.RoomID
36 response.ServerNames = dir.Servers
37 r.statistics.ForServer(request.ServerName).Success()
38 return nil
39}
40
41type federatedJoin struct {
42 UserID string

Callers

nothing calls this directly

Calls 4

LookupRoomAliasMethod · 0.80
FailureMethod · 0.45
ForServerMethod · 0.45
SuccessMethod · 0.45

Tested by

no test coverage detected