Documentation ¶
Index ¶
- func AddMortgage(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func AddTelNumbers(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func AddTmpAuthInfo(profileAPI userapi.ClientUserAPI, req *http.Request, device *api.Device, ...) util.JSONResponse
- func AdminEvacuateRoom(req *http.Request, device *userapi.Device, ...) util.JSONResponse
- func AdminEvacuateUser(req *http.Request, device *userapi.Device, ...) util.JSONResponse
- func AuthFallback(w http.ResponseWriter, req *http.Request, authType string, ...) *util.JSONResponse
- func CheckAndSave3PIDAssociation(req *http.Request, threePIDAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func ClaimKeys(req *http.Request, keyAPI api.ClientKeyAPI) util.JSONResponse
- func CreateKeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device) util.JSONResponse
- func CreateOpenIDToken(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func CreateRoom(req *http.Request, device *api.Device, cfg *config.ClientAPI, ...) util.JSONResponse
- func Deactivate(req *http.Request, userInteractiveAuth *auth.UserInteractive, ...) util.JSONResponse
- func DelTmpAuthInfo(req *http.Request, device *api.Device, cfg *config.ClientAPI) util.JSONResponse
- func DeleteDeviceById(req *http.Request, userInteractiveAuth *auth.UserInteractive, ...) util.JSONResponse
- func DeleteDevices(req *http.Request, userAPI api.ClientUserAPI, device *api.Device) util.JSONResponse
- func DeleteKeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func DeletePushRuleByRuleID(ctx context.Context, scope, kind, ruleID string, device *userapi.Device, ...) util.JSONResponse
- func DeleteTag(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func DirectoryRoom(req *http.Request, roomAlias string, ...) util.JSONResponse
- func Forget3PID(req *http.Request, threepidAPI api.ClientUserAPI) util.JSONResponse
- func GetAccountData(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func GetAdminWhois(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func GetAliases(req *http.Request, rsAPI api.ClientRoomserverAPI, device *userapi.Device, ...) util.JSONResponse
- func GetAllPushRules(ctx context.Context, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
- func GetAssociated3PIDs(req *http.Request, threepidAPI api.ClientUserAPI, device *api.Device) util.JSONResponse
- func GetAvatarURL(req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ...) util.JSONResponse
- func GetBackupKeys(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func GetCapabilities(req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI) util.JSONResponse
- func GetDeviceByID(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func GetDevicesByLocalpart(req *http.Request, userAPI api.ClientUserAPI, device *api.Device) util.JSONResponse
- func GetDisplayName(req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ...) util.JSONResponse
- func GetEvent(req *http.Request, device *userapi.Device, roomID string, eventID string, ...) util.JSONResponse
- func GetHostByServerNode(req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ...) util.JSONResponse
- func GetInactiveUsersByRoom(req *http.Request, device *api.Device, roomId string, cfg *config.ClientAPI, ...) util.JSONResponse
- func GetJoinedRooms(req *http.Request, device *userapi.Device, rsAPI api.ClientRoomserverAPI) util.JSONResponse
- func GetMemberships(req *http.Request, device *userapi.Device, roomID string, joinedOnly bool, ...) util.JSONResponse
- func GetNotifications(req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
- func GetPostPublicRooms(req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func GetPresence(req *http.Request, device *api.Device, natsClient *nats.Conn, ...) util.JSONResponse
- func GetProfile(req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ...) util.JSONResponse
- func GetPushRuleAttrByRuleID(ctx context.Context, scope, kind, ruleID, attr string, device *userapi.Device, ...) util.JSONResponse
- func GetPushRuleByRuleID(ctx context.Context, scope, kind, ruleID string, device *userapi.Device, ...) util.JSONResponse
- func GetPushRulesByKind(ctx context.Context, scope, kind string, device *userapi.Device, ...) util.JSONResponse
- func GetPushRulesByScope(ctx context.Context, scope string, device *userapi.Device, ...) util.JSONResponse
- func GetPushers(req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
- func GetTags(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func GetUserByPhone(req *http.Request, device *api.Device, profileAPI userapi.ClientUserAPI, ...) util.JSONResponse
- func GetUserOffline2DayOrInactive3Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, ...) (overTwoDays []string, inactiveFor3Days []string, err error)
- func GetUserOffline3DayOrInactive3Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, ...) (overThreeDays []string, inactiveFor3Days []string, err error)
- func GetUserOffline7DayOrInactive7Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, ...) (overSevenDays []string, inactiveFor7Days []string, err error)
- func GetVisibility(req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, roomID string) util.JSONResponse
- func InsertAddressBook(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func InsertChainData(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func InsertRelationInvite(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func JoinRoomByIDOrAlias(req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func KeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func LeaveRoomByID(req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func Login(req *http.Request, userAPI userapi.ClientUserAPI, cfg *config.ClientAPI) util.JSONResponse
- func Logout(req *http.Request, userAPI api.ClientUserAPI, device *api.Device) util.JSONResponse
- func LogoutAll(req *http.Request, userAPI api.ClientUserAPI, device *api.Device) util.JSONResponse
- func ModifyKeyBackupVersionAuthData(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func OnIncomingStateRequest(ctx context.Context, device *userapi.Device, rsAPI api.ClientRoomserverAPI, ...) util.JSONResponse
- func OnIncomingStateTypeRequest(ctx context.Context, device *userapi.Device, rsAPI api.ClientRoomserverAPI, ...) util.JSONResponse
- func Password(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func PeekRoomByIDOrAlias(req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func PostJSON(ctx context.Context, httpClient *http.Client, apiURL string, ...) error
- func PutPushRuleAttrByRuleID(ctx context.Context, scope, kind, ruleID, attr string, body io.Reader, ...) util.JSONResponse
- func PutPushRuleByRuleID(ctx context.Context, scope, kind, ruleID, afterRuleID, beforeRuleID string, ...) util.JSONResponse
- func PutTag(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func QueryAvailableUsers(req *http.Request, device *api.Device) util.JSONResponse
- func QueryKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
- func Register(req *http.Request, userAPI userapi.ClientUserAPI, cfg *config.ClientAPI) util.JSONResponse
- func RegisterAvailable(req *http.Request, cfg *config.ClientAPI, registerAPI userapi.ClientUserAPI) util.JSONResponse
- func RejoinCluster(req *http.Request, device *api.Device, roomId string, cfg *config.ClientAPI, ...) util.JSONResponse
- func RemoveLocalAlias(req *http.Request, device *userapi.Device, alias string, ...) util.JSONResponse
- func RequestEmailToken(req *http.Request, threePIDAPI api.ClientUserAPI, cfg *config.ClientAPI) util.JSONResponse
- func RequestTurnServer(profileAPI userapi.ClientUserAPI, req *http.Request, device *api.Device, ...) util.JSONResponse
- func SaveAccountData(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func SaveReadMarker(req *http.Request, userAPI api.ClientUserAPI, ...) util.JSONResponse
- func SearchUserDirectory(ctx context.Context, device *userapi.Device, userAPI userapi.ClientUserAPI, ...) util.JSONResponse
- func SendBan(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SendEvent(req *http.Request, device *userapi.Device, roomID, eventType string, ...) util.JSONResponse
- func SendForget(req *http.Request, device *userapi.Device, roomID string, ...) util.JSONResponse
- func SendGroupMasterNotice(req *http.Request, cfgClient *config.ClientAPI, userAPI userapi.ClientUserAPI, ...) util.JSONResponse
- func SendInvite(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SendInviteAsRoomOwner(ctx context.Context, profileAPI userapi.ClientUserAPI, ...) util.JSONResponse
- func SendKick(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SendLeaveAsRoomOwner(ctx context.Context, profileAPI userapi.ClientUserAPI, ...) util.JSONResponse
- func SendRedaction(req *http.Request, device *userapi.Device, roomID, eventID string, ...) util.JSONResponse
- func SendServerNotice(req *http.Request, cfgNotices *config.ServerNotices, ...) util.JSONResponse
- func SendToDevice(req *http.Request, device *userapi.Device, ...) util.JSONResponse
- func SendTyping(req *http.Request, device *userapi.Device, roomID string, userID string, ...) util.JSONResponse
- func SendUnban(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SetAvatarURL(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SetChatFee(req *http.Request, profileAPI userapi.ClientUserAPI) util.JSONResponse
- func SetDisplayName(req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func SetLocalAlias(req *http.Request, device *userapi.Device, alias string, cfg *config.ClientAPI, ...) util.JSONResponse
- func SetPresence(req *http.Request, cfg *config.ClientAPI, device *api.Device, ...) util.JSONResponse
- func SetPusher(req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
- func SetReceipt(req *http.Request, syncProducer *producers.SyncAPIProducer, ...) util.JSONResponse
- func SetVisibility(req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func Setup(publicAPIMux, wkMux, synapseAdminRouter, dendriteAdminRouter *mux.Router, ...)
- func UnpeekRoomByID(req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, ...) util.JSONResponse
- func UpdateDeviceByID(req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ...) util.JSONResponse
- func UpgradeRoom(req *http.Request, device *userapi.Device, cfg *config.ClientAPI, ...) util.JSONResponse
- func UploadBackupKeys(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, ...) util.JSONResponse
- func UploadCrossSigningDeviceKeys(req *http.Request, userInteractiveAuth *auth.UserInteractive, ...) util.JSONResponse
- func UploadCrossSigningDeviceSignatures(req *http.Request, keyserverAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
- func UploadKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
- func UserIDIsWithinApplicationServiceNamespace(cfg *config.ClientAPI, userID string, appservice *config.ApplicationService) bool
- func UsernameMatchesExclusiveNamespaces(cfg *config.ClientAPI, username string) bool
- func UsernameMatchesMultipleExclusiveNamespaces(cfg *config.ClientAPI, username string) bool
- func ValidateCreateRoomReq(ctx context.Context, r createRoomRequest, device *api.Device, ...) error
- func Whoami(req *http.Request, device *api.Device) util.JSONResponse
- type GetUserByPhoneReq
- type PublicRoomReq
- type QueryAvailableReq
- type SharedSecretRegistration
- type SharedSecretRegistrationRequest
- type UserDirectoryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMortgage ¶
func AddMortgage( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
AddMortgage implements POST /local/add/mortgage
func AddTelNumbers ¶
func AddTelNumbers( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
AddTelNumbers implements POST /local/add/telNumbers
func AddTmpAuthInfo ¶
func AddTmpAuthInfo(profileAPI userapi.ClientUserAPI, req *http.Request, device *api.Device, cfg *config.ClientAPI) util.JSONResponse
POST /voip/turnAuthTmpAdd
func AdminEvacuateRoom ¶
func AdminEvacuateRoom(req *http.Request, device *userapi.Device, rsAPI roomserverAPI.ClientRoomserverAPI) util.JSONResponse
func AdminEvacuateUser ¶
func AdminEvacuateUser(req *http.Request, device *userapi.Device, rsAPI roomserverAPI.ClientRoomserverAPI) util.JSONResponse
func AuthFallback ¶
func AuthFallback( w http.ResponseWriter, req *http.Request, authType string, cfg *config.ClientAPI, ) *util.JSONResponse
AuthFallback implements GET and POST /auth/{authType}/fallback/web?session={sessionID}
func CheckAndSave3PIDAssociation ¶
func CheckAndSave3PIDAssociation( req *http.Request, threePIDAPI api.ClientUserAPI, device *api.Device, cfg *config.ClientAPI, ) util.JSONResponse
CheckAndSave3PIDAssociation implements POST /account/3pid
func ClaimKeys ¶
func ClaimKeys(req *http.Request, keyAPI api.ClientKeyAPI) util.JSONResponse
func CreateKeyBackupVersion ¶
func CreateKeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device) util.JSONResponse
Create a new key backup. Request must contain a `keyBackupVersion`. Returns a `keyBackupVersionCreateResponse`. Implements POST /_matrix/client/r0/room_keys/version
func CreateOpenIDToken ¶
func CreateOpenIDToken( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, cfg *config.ClientAPI, ) util.JSONResponse
CreateOpenIDToken creates a new OpenID Connect (OIDC) token that a Matrix user can supply to an OpenID Relying Party to verify their identity
func CreateRoom ¶
func CreateRoom( req *http.Request, device *api.Device, cfg *config.ClientAPI, profileAPI api.ClientUserAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
CreateRoom implements /createRoom
func Deactivate ¶
func Deactivate( req *http.Request, userInteractiveAuth *auth.UserInteractive, accountAPI api.ClientUserAPI, deviceAPI *api.Device, ) util.JSONResponse
Deactivate handles POST requests to /account/deactivate
func DelTmpAuthInfo ¶
POST /voip/turnAuthTmpDel
func DeleteDeviceById ¶
func DeleteDeviceById( req *http.Request, userInteractiveAuth *auth.UserInteractive, userAPI api.ClientUserAPI, device *api.Device, deviceID string, ) util.JSONResponse
DeleteDeviceById handles DELETE requests to /devices/{deviceId}
func DeleteDevices ¶
func DeleteDevices( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ) util.JSONResponse
DeleteDevices handles POST requests to /delete_devices
func DeleteKeyBackupVersion ¶
func DeleteKeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, version string) util.JSONResponse
Delete a version of key backup. Version must not be empty. If the key backup was previously deleted, will return 200 OK. Implements DELETE /_matrix/client/r0/room_keys/version/{version}
func DeletePushRuleByRuleID ¶
func DeletePushRuleByRuleID(ctx context.Context, scope, kind, ruleID string, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func DeleteTag ¶
func DeleteTag( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, roomID string, tag string, syncProducer *producers.SyncAPIProducer, ) util.JSONResponse
DeleteTag implements DELETE /_matrix/client/r0/user/{userID}/rooms/{roomID}/tags/{tag} Delete functionality works by obtaining the saved tags, removing the intended tag from the "map" and then saving the new "map" in the DB
func DirectoryRoom ¶
func DirectoryRoom( req *http.Request, roomAlias string, federation *gomatrixserverlib.FederationClient, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, fedSenderAPI federationAPI.ClientFederationAPI, ) util.JSONResponse
DirectoryRoom looks up a room alias
func Forget3PID ¶
func Forget3PID(req *http.Request, threepidAPI api.ClientUserAPI) util.JSONResponse
Forget3PID implements POST /account/3pid/delete
func GetAccountData ¶
func GetAccountData( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, roomID string, dataType string, ) util.JSONResponse
GetAccountData implements GET /user/{userId}/[rooms/{roomid}/]account_data/{type}
func GetAdminWhois ¶
func GetAdminWhois( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, ) util.JSONResponse
GetAdminWhois implements GET /admin/whois/{userId}
func GetAliases ¶
func GetAliases( req *http.Request, rsAPI api.ClientRoomserverAPI, device *userapi.Device, roomID string, ) util.JSONResponse
GetAliases implements GET /_matrix/client/r0/rooms/{roomId}/aliases
func GetAllPushRules ¶
func GetAllPushRules(ctx context.Context, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func GetAssociated3PIDs ¶
func GetAssociated3PIDs( req *http.Request, threepidAPI api.ClientUserAPI, device *api.Device, ) util.JSONResponse
GetAssociated3PIDs implements GET /account/3pid
func GetAvatarURL ¶
func GetAvatarURL( req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, userID string, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
GetAvatarURL implements GET /profile/{userID}/avatar_url
func GetBackupKeys ¶
func GetBackupKeys( req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, version, roomID, sessionID string, ) util.JSONResponse
Get keys from a given backup version. Response returned varies depending on if roomID and sessionID are set.
func GetCapabilities ¶
func GetCapabilities( req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, ) util.JSONResponse
GetCapabilities returns information about the server's supported feature set and other relevant capabilities to an authenticated user.
func GetDeviceByID ¶
func GetDeviceByID( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, deviceID string, ) util.JSONResponse
GetDeviceByID handles /devices/{deviceID}
func GetDevicesByLocalpart ¶
func GetDevicesByLocalpart( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ) util.JSONResponse
GetDevicesByLocalpart handles /devices
func GetDisplayName ¶
func GetDisplayName( req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, userID string, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
GetDisplayName implements GET /profile/{userID}/displayname
func GetEvent ¶
func GetEvent( req *http.Request, device *userapi.Device, roomID string, eventID string, cfg *config.ClientAPI, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
GetEvent implements GET /_matrix/client/r0/rooms/{roomId}/event/{eventId} https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-rooms-roomid-event-eventid
func GetHostByServerNode ¶
func GetHostByServerNode( req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, nodeName string, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
GetHostByServerNode implements GET /get/host/of/{nodeName}
func GetInactiveUsersByRoom ¶
func GetInactiveUsersByRoom(req *http.Request, device *api.Device, roomId string, cfg *config.ClientAPI, federation *gomatrixserverlib.FederationClient) util.JSONResponse
func GetJoinedRooms ¶
func GetJoinedRooms( req *http.Request, device *userapi.Device, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
func GetMemberships ¶
func GetMemberships( req *http.Request, device *userapi.Device, roomID string, joinedOnly bool, _ *config.ClientAPI, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
GetMemberships implements GET /rooms/{roomId}/members
func GetNotifications ¶
func GetNotifications( req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI, ) util.JSONResponse
GetNotifications handles /_matrix/client/r0/notifications
func GetPostPublicRooms ¶
func GetPostPublicRooms( req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, extRoomsProvider api.ExtraPublicRoomsProvider, federation *gomatrixserverlib.FederationClient, cfg *config.ClientAPI, ) util.JSONResponse
GetPostPublicRooms implements GET and POST /publicRooms
func GetPresence ¶
func GetProfile ¶
func GetProfile( req *http.Request, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, userID string, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient, ) util.JSONResponse
GetProfile implements GET /profile/{userID}
func GetPushRuleAttrByRuleID ¶
func GetPushRuleAttrByRuleID(ctx context.Context, scope, kind, ruleID, attr string, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func GetPushRuleByRuleID ¶
func GetPushRuleByRuleID(ctx context.Context, scope, kind, ruleID string, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func GetPushRulesByKind ¶
func GetPushRulesByKind(ctx context.Context, scope, kind string, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func GetPushRulesByScope ¶
func GetPushRulesByScope(ctx context.Context, scope string, device *userapi.Device, userAPI userapi.ClientUserAPI) util.JSONResponse
func GetPushers ¶
func GetPushers( req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI, ) util.JSONResponse
GetPushers handles /_matrix/client/r0/pushers
func GetTags ¶
func GetTags( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, roomID string, syncProducer *producers.SyncAPIProducer, ) util.JSONResponse
GetTags implements GET /_matrix/client/r0/user/{userID}/rooms/{roomID}/tags
func GetUserByPhone ¶
func GetUserByPhone(req *http.Request, device *api.Device, profileAPI userapi.ClientUserAPI, cfg *config.ClientAPI, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient) util.JSONResponse
func GetUserOffline2DayOrInactive3Day ¶
func GetUserOffline2DayOrInactive3Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, userIds []string, server string) (overTwoDays []string, inactiveFor3Days []string, err error)
func GetUserOffline3DayOrInactive3Day ¶
func GetUserOffline3DayOrInactive3Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, userIds []string, server string) (overThreeDays []string, inactiveFor3Days []string, err error)
func GetUserOffline7DayOrInactive7Day ¶
func GetUserOffline7DayOrInactive7Day(ctx context.Context, federation *gomatrixserverlib.FederationClient, userIds []string, server string) (overSevenDays []string, inactiveFor7Days []string, err error)
func GetVisibility ¶
func GetVisibility( req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, roomID string, ) util.JSONResponse
GetVisibility implements GET /directory/list/room/{roomID}
func InsertAddressBook ¶
func InsertAddressBook( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
InsertAddressBook implements POST /local/insert/addressBook
func InsertChainData ¶
func InsertChainData( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
InsertChainData implements POST /local/insert/chainData
func InsertRelationInvite ¶
func InsertRelationInvite( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
InsertRelationInvite implements POST /local/insert/relationInvite
func JoinRoomByIDOrAlias ¶
func JoinRoomByIDOrAlias( req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, profileAPI api.ClientUserAPI, roomIDOrAlias string, ) util.JSONResponse
func KeyBackupVersion ¶
func KeyBackupVersion(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, version string) util.JSONResponse
KeyBackupVersion returns the key backup version specified. If `version` is empty, the latest `keyBackupVersionResponse` is returned. Implements GET /_matrix/client/r0/room_keys/version and GET /_matrix/client/r0/room_keys/version/{version}
func LeaveRoomByID ¶
func LeaveRoomByID( req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, roomID string, ) util.JSONResponse
func Login ¶
func Login( req *http.Request, userAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ) util.JSONResponse
Login implements GET and POST /login
func Logout ¶
func Logout( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ) util.JSONResponse
Logout handles POST /logout
func LogoutAll ¶
func LogoutAll( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, ) util.JSONResponse
LogoutAll handles POST /logout/all
func ModifyKeyBackupVersionAuthData ¶
func ModifyKeyBackupVersionAuthData(req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, version string) util.JSONResponse
Modify the auth data of a key backup. Version must not be empty. Request must contain a `keyBackupVersion` Implements PUT /_matrix/client/r0/room_keys/version/{version}
func OnIncomingStateRequest ¶
func OnIncomingStateRequest(ctx context.Context, device *userapi.Device, rsAPI api.ClientRoomserverAPI, roomID string) util.JSONResponse
OnIncomingStateRequest is called when a client makes a /rooms/{roomID}/state request. It will fetch all the state events from the specified room and will append the necessary keys to them if applicable before returning them. Returns an error if something went wrong in the process. TODO: Check if the user is in the room. If not, check if the room's history is publicly visible. Current behaviour is returning an empty array if the user cannot see the room's history.
func OnIncomingStateTypeRequest ¶
func OnIncomingStateTypeRequest( ctx context.Context, device *userapi.Device, rsAPI api.ClientRoomserverAPI, roomID, evType, stateKey string, eventFormat bool, ) util.JSONResponse
OnIncomingStateTypeRequest is called when a client makes a /rooms/{roomID}/state/{type}/{statekey} request. It will look in current state to see if there is an event with that type and state key, if there is then (by default) we return the content, otherwise a 404. If eventFormat=true, sends the whole event else just the content.
func Password ¶
func Password( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, cfg *config.ClientAPI, ) util.JSONResponse
func PeekRoomByIDOrAlias ¶
func PeekRoomByIDOrAlias( req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, roomIDOrAlias string, ) util.JSONResponse
func PostJSON ¶
func PostJSON( ctx context.Context, httpClient *http.Client, apiURL string, request, response interface{}, ) error
PostJSON performs a POST request with JSON on an internal HTTP API
func PutPushRuleAttrByRuleID ¶
func PutPushRuleByRuleID ¶
func PutTag ¶
func PutTag( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, roomID string, tag string, syncProducer *producers.SyncAPIProducer, ) util.JSONResponse
PutTag implements PUT /_matrix/client/r0/user/{userID}/rooms/{roomID}/tags/{tag} Put functionality works by getting existing data from the DB (if any), adding the tag to the "map" and saving the new "map" to the DB
func QueryAvailableUsers ¶
QueryAvailableUsers implements /new/query_available_users/by/locals
func QueryKeys ¶
func QueryKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
func Register ¶
func Register( req *http.Request, userAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ) util.JSONResponse
Register processes a /register request. http://matrix.org/speculator/spec/HEAD/client_server/unstable.html#post-matrix-client-unstable-register
func RegisterAvailable ¶
func RegisterAvailable( req *http.Request, cfg *config.ClientAPI, registerAPI userapi.ClientUserAPI, ) util.JSONResponse
RegisterAvailable checks if the username is already taken or invalid.
func RejoinCluster ¶
func RejoinCluster(req *http.Request, device *api.Device, roomId string, cfg *config.ClientAPI, profileAPI api.ClientUserAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, federation *gomatrixserverlib.FederationClient) util.JSONResponse
RejoinCluster
func RemoveLocalAlias ¶
func RemoveLocalAlias( req *http.Request, device *userapi.Device, alias string, rsAPI roomserverAPI.ClientRoomserverAPI, ) util.JSONResponse
RemoveLocalAlias implements DELETE /directory/room/{roomAlias}
func RequestEmailToken ¶
func RequestEmailToken(req *http.Request, threePIDAPI api.ClientUserAPI, cfg *config.ClientAPI) util.JSONResponse
POST /account/3pid/email/requestToken POST /register/email/requestToken
func RequestTurnServer ¶
func RequestTurnServer(profileAPI userapi.ClientUserAPI, req *http.Request, device *api.Device, cfg *config.ClientAPI) util.JSONResponse
GET /voip/turnServer
func SaveAccountData ¶
func SaveAccountData( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, userID string, roomID string, dataType string, syncProducer *producers.SyncAPIProducer, ) util.JSONResponse
SaveAccountData implements PUT /user/{userId}/[rooms/{roomId}/]account_data/{type}
func SaveReadMarker ¶
func SaveReadMarker( req *http.Request, userAPI api.ClientUserAPI, rsAPI roomserverAPI.ClientRoomserverAPI, syncProducer *producers.SyncAPIProducer, device *api.Device, roomID string, ) util.JSONResponse
SaveReadMarker implements POST /rooms/{roomId}/read_markers
func SearchUserDirectory ¶
func SearchUserDirectory( ctx context.Context, device *userapi.Device, userAPI userapi.ClientUserAPI, rsAPI api.ClientRoomserverAPI, provider userapi.QuerySearchProfilesAPI, serverName gomatrixserverlib.ServerName, searchString string, limit int, ) util.JSONResponse
func SendBan ¶
func SendBan( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, roomID string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
func SendEvent ¶
func SendEvent( req *http.Request, device *userapi.Device, roomID, eventType string, txnID, stateKey *string, cfg *config.ClientAPI, rsAPI api.ClientRoomserverAPI, txnCache *transactions.Cache, ) util.JSONResponse
/rooms/{roomID}/send/{eventType} /rooms/{roomID}/send/{eventType}/{txnID} /rooms/{roomID}/state/{eventType}/{stateKey}
func SendForget ¶
func SendForget( req *http.Request, device *userapi.Device, roomID string, rsAPI roomserverAPI.ClientRoomserverAPI, ) util.JSONResponse
func SendGroupMasterNotice ¶
func SendGroupMasterNotice( req *http.Request, cfgClient *config.ClientAPI, userAPI userapi.ClientUserAPI, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
func SendInvite ¶
func SendInvite( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, roomID string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
func SendInviteAsRoomOwner ¶
func SendInviteAsRoomOwner(ctx context.Context, profileAPI userapi.ClientUserAPI, roomID, userID, reason string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, evTime time.Time) util.JSONResponse
func SendKick ¶
func SendKick( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, roomID string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
func SendLeaveAsRoomOwner ¶
func SendLeaveAsRoomOwner(ctx context.Context, profileAPI userapi.ClientUserAPI, roomID, userID, reason string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, evTime time.Time) util.JSONResponse
SendLeaveAsRoomOwner
func SendRedaction ¶
func SendRedaction( req *http.Request, device *userapi.Device, roomID, eventID string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, txnID *string, txnCache *transactions.Cache, ) util.JSONResponse
func SendServerNotice ¶
func SendServerNotice( req *http.Request, cfgNotices *config.ServerNotices, cfgClient *config.ClientAPI, userAPI userapi.ClientUserAPI, rsAPI api.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, device *userapi.Device, senderDevice *userapi.Device, txnID *string, txnCache *transactions.Cache, ) util.JSONResponse
SendServerNotice sends a message to a specific user. It can only be invoked by an admin.
func SendToDevice ¶
func SendToDevice( req *http.Request, device *userapi.Device, syncProducer *producers.SyncAPIProducer, txnCache *transactions.Cache, eventType string, txnID *string, ) util.JSONResponse
SendToDevice handles PUT /_matrix/client/r0/sendToDevice/{eventType}/{txnId} sends the device events to the syncapi & federationsender
func SendTyping ¶
func SendTyping( req *http.Request, device *userapi.Device, roomID string, userID string, rsAPI roomserverAPI.ClientRoomserverAPI, syncProducer *producers.SyncAPIProducer, ) util.JSONResponse
SendTyping handles PUT /rooms/{roomID}/typing/{userID} sends the typing events to client API typingProducer
func SendUnban ¶
func SendUnban( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, roomID string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
func SetAvatarURL ¶
func SetAvatarURL( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, userID string, cfg *config.ClientAPI, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
SetAvatarURL implements PUT /profile/{userID}/avatar_url
func SetChatFee ¶
func SetChatFee( req *http.Request, profileAPI userapi.ClientUserAPI, ) util.JSONResponse
SetChatFee implements POST /local/set/chatFee
func SetDisplayName ¶
func SetDisplayName( req *http.Request, profileAPI userapi.ClientUserAPI, device *userapi.Device, userID string, cfg *config.ClientAPI, rsAPI api.ClientRoomserverAPI, ) util.JSONResponse
SetDisplayName implements PUT /profile/{userID}/displayname
func SetLocalAlias ¶
func SetLocalAlias( req *http.Request, device *userapi.Device, alias string, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, ) util.JSONResponse
SetLocalAlias implements PUT /directory/room/{roomAlias}
func SetPresence ¶
func SetPusher ¶
func SetPusher( req *http.Request, device *userapi.Device, userAPI userapi.ClientUserAPI, ) util.JSONResponse
SetPusher handles /_matrix/client/r0/pushers/set This endpoint allows the creation, modification and deletion of pushers for this user ID. The behaviour of this endpoint varies depending on the values in the JSON body.
func SetReceipt ¶
func SetReceipt(req *http.Request, syncProducer *producers.SyncAPIProducer, device *userapi.Device, roomID, receiptType, eventID string) util.JSONResponse
func SetVisibility ¶
func SetVisibility( req *http.Request, rsAPI roomserverAPI.ClientRoomserverAPI, dev *userapi.Device, roomID string, ) util.JSONResponse
SetVisibility implements PUT /directory/list/room/{roomID} TODO: Allow admin users to edit the room visibility
func Setup ¶
func Setup( publicAPIMux, wkMux, synapseAdminRouter, dendriteAdminRouter *mux.Router, cfg *config.ClientAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, userAPI userapi.ClientUserAPI, userDirectoryProvider userapi.QuerySearchProfilesAPI, federation *gomatrixserverlib.FederationClient, syncProducer *producers.SyncAPIProducer, transactionsCache *transactions.Cache, federationSender federationAPI.ClientFederationAPI, keyAPI keyserverAPI.ClientKeyAPI, extRoomsProvider api.ExtraPublicRoomsProvider, mscCfg *config.MSCs, natsClient *nats.Conn, )
Due to Setup being used to call many other functions, a gocyclo nolint is applied: nolint: gocyclo
func UnpeekRoomByID ¶
func UnpeekRoomByID( req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI, roomID string, ) util.JSONResponse
func UpdateDeviceByID ¶
func UpdateDeviceByID( req *http.Request, userAPI api.ClientUserAPI, device *api.Device, deviceID string, ) util.JSONResponse
UpdateDeviceByID handles PUT on /devices/{deviceID}
func UpgradeRoom ¶
func UpgradeRoom( req *http.Request, device *userapi.Device, cfg *config.ClientAPI, roomID string, profileAPI userapi.ClientUserAPI, rsAPI roomserverAPI.ClientRoomserverAPI, asAPI appserviceAPI.AppServiceInternalAPI, ) util.JSONResponse
UpgradeRoom implements /upgrade
func UploadBackupKeys ¶
func UploadBackupKeys( req *http.Request, userAPI userapi.ClientUserAPI, device *userapi.Device, version string, keys *keyBackupSessionRequest, ) util.JSONResponse
Upload a bunch of session keys for a given `version`.
func UploadCrossSigningDeviceKeys ¶
func UploadCrossSigningDeviceKeys( req *http.Request, userInteractiveAuth *auth.UserInteractive, keyserverAPI api.ClientKeyAPI, device *userapi.Device, accountAPI userapi.ClientUserAPI, cfg *config.ClientAPI, ) util.JSONResponse
func UploadCrossSigningDeviceSignatures ¶
func UploadCrossSigningDeviceSignatures(req *http.Request, keyserverAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
func UploadKeys ¶
func UploadKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse
func UserIDIsWithinApplicationServiceNamespace ¶
func UserIDIsWithinApplicationServiceNamespace( cfg *config.ClientAPI, userID string, appservice *config.ApplicationService, ) bool
UserIDIsWithinApplicationServiceNamespace checks to see if a given userID falls within any of the namespaces of a given Application Service. If no Application Service is given, it will check to see if it matches any Application Service's namespace.
func UsernameMatchesExclusiveNamespaces ¶
UsernameMatchesExclusiveNamespaces will check if a given username matches any application service's exclusive users namespace
func UsernameMatchesMultipleExclusiveNamespaces ¶
UsernameMatchesMultipleExclusiveNamespaces will check if a given username matches more than one exclusive namespace. More than one is not allowed
func ValidateCreateRoomReq ¶
func Whoami ¶
Whoami implements `/account/whoami` which enables client to query their account user id. https://matrix.org/docs/spec/client_server/r0.3.0.html#get-matrix-client-r0-account-whoami
Types ¶
type GetUserByPhoneReq ¶
type GetUserByPhoneReq struct {
Phone int64 `json:"phone"`
}
type PublicRoomReq ¶
type QueryAvailableReq ¶
type QueryAvailableReq struct {
Locals []string `json:"locals"`
}
type SharedSecretRegistration ¶
type SharedSecretRegistration struct {
// contains filtered or unexported fields
}
func NewSharedSecretRegistration ¶
func NewSharedSecretRegistration(sharedSecret string) *SharedSecretRegistration
func (*SharedSecretRegistration) GenerateNonce ¶
func (r *SharedSecretRegistration) GenerateNonce() string
func (*SharedSecretRegistration) IsValidMacLogin ¶
type SharedSecretRegistrationRequest ¶
type SharedSecretRegistrationRequest struct {}
func NewSharedSecretRegistrationRequest ¶
func NewSharedSecretRegistrationRequest(reader io.ReadCloser) (*SharedSecretRegistrationRequest, error)
type UserDirectoryResponse ¶
type UserDirectoryResponse struct { Results []authtypes.FullyQualifiedProfile `json:"results"` Limited bool `json:"limited"` }
Source Files ¶
- account_data.go
- activate_user.go
- admin.go
- admin_whois.go
- aliases.go
- auth_fallback.go
- capabilities.go
- cluster.go
- createroom.go
- deactivate.go
- device.go
- directory.go
- directory_public.go
- getevent.go
- group_master_notice.go
- joinroom.go
- key_backup.go
- key_crosssigning.go
- keys.go
- leaveroom.go
- login.go
- logout.go
- membership.go
- memberships.go
- new_feature.go
- notification.go
- openid.go
- password.go
- peekroom.go
- presence.go
- profile.go
- pusher.go
- pushrules.go
- receipt.go
- redaction.go
- register.go
- register_secret.go
- room_tagging.go
- routing.go
- sendevent.go
- sendtodevice.go
- sendtyping.go
- server_notices.go
- servers.go
- state.go
- threepid.go
- upgrade_room.go
- userdirectory.go
- voip.go
- whoami.go