This commit is contained in:
Erik Johnston 2017-07-11 11:52:03 +01:00
parent 8ba89f1050
commit 6322fbbd41
2 changed files with 26 additions and 0 deletions

View file

@ -474,6 +474,10 @@ class TransportLayerClient(object):
@log_function @log_function
def invite_to_group_notification(self, destination, group_id, user_id, content): def invite_to_group_notification(self, destination, group_id, user_id, content):
"""Sent by group server to inform a user's server that they have been
invited.
"""
path = PREFIX + "/groups/local/%s/users/%s/invite" % (group_id, user_id) path = PREFIX + "/groups/local/%s/users/%s/invite" % (group_id, user_id)
return self.client.post_json( return self.client.post_json(
@ -486,6 +490,10 @@ class TransportLayerClient(object):
@log_function @log_function
def remove_user_from_group_notification(self, destination, group_id, user_id, def remove_user_from_group_notification(self, destination, group_id, user_id,
content): content):
"""Sent by group server to inform a user's server that they have been
kicked from the group.
"""
path = PREFIX + "/groups/local/%s/users/%s/remove" % (group_id, user_id) path = PREFIX + "/groups/local/%s/users/%s/remove" % (group_id, user_id)
return self.client.post_json( return self.client.post_json(
@ -497,6 +505,10 @@ class TransportLayerClient(object):
@log_function @log_function
def renew_group_attestation(self, destination, group_id, user_id, content): def renew_group_attestation(self, destination, group_id, user_id, content):
"""Sent by either a group server or a user's server to periodically update
the attestations
"""
path = PREFIX + "/groups/%s/renew_attestation/%s" % (group_id, user_id) path = PREFIX + "/groups/%s/renew_attestation/%s" % (group_id, user_id)
return self.client.post_json( return self.client.post_json(

View file

@ -610,6 +610,8 @@ class FederationVersionServlet(BaseFederationServlet):
class FederationGroupsProfileServlet(BaseFederationServlet): class FederationGroupsProfileServlet(BaseFederationServlet):
"""Get the basic profile of a group on behalf of a user
"""
PATH = "/groups/(?P<group_id>[^/]*)/profile$" PATH = "/groups/(?P<group_id>[^/]*)/profile$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -626,6 +628,8 @@ class FederationGroupsProfileServlet(BaseFederationServlet):
class FederationGroupsRoomsServlet(BaseFederationServlet): class FederationGroupsRoomsServlet(BaseFederationServlet):
"""Get the rooms in a group on behalf of a user
"""
PATH = "/groups/(?P<group_id>[^/]*)/rooms$" PATH = "/groups/(?P<group_id>[^/]*)/rooms$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -642,6 +646,8 @@ class FederationGroupsRoomsServlet(BaseFederationServlet):
class FederationGroupsUsersServlet(BaseFederationServlet): class FederationGroupsUsersServlet(BaseFederationServlet):
"""Get the users in a group on behalf of a user
"""
PATH = "/groups/(?P<group_id>[^/]*)/users$" PATH = "/groups/(?P<group_id>[^/]*)/users$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -658,6 +664,8 @@ class FederationGroupsUsersServlet(BaseFederationServlet):
class FederationGroupsInviteServlet(BaseFederationServlet): class FederationGroupsInviteServlet(BaseFederationServlet):
"""Ask a group server to invite someone to the group
"""
PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/invite$" PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/invite$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -674,6 +682,8 @@ class FederationGroupsInviteServlet(BaseFederationServlet):
class FederationGroupsAcceptInviteServlet(BaseFederationServlet): class FederationGroupsAcceptInviteServlet(BaseFederationServlet):
"""Accept an invitation from the group server
"""
PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/accept_invite$" PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/accept_invite$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -689,6 +699,8 @@ class FederationGroupsAcceptInviteServlet(BaseFederationServlet):
class FederationGroupsRemoveUserServlet(BaseFederationServlet): class FederationGroupsRemoveUserServlet(BaseFederationServlet):
"""Leave or kick a user from the group
"""
PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/remove$" PATH = "/groups/(?P<group_id>[^/]*)/users/(?P<user_id>[^/]*)/remove$"
@defer.inlineCallbacks @defer.inlineCallbacks
@ -705,6 +717,8 @@ class FederationGroupsRemoveUserServlet(BaseFederationServlet):
class FederationGroupsRenewAttestaionServlet(BaseFederationServlet): class FederationGroupsRenewAttestaionServlet(BaseFederationServlet):
"""A group or user's server renews their attestation
"""
PATH = "/groups/(?P<group_id>[^/]*)/renew_attestation/(?P<user_id>[^/]*)$" PATH = "/groups/(?P<group_id>[^/]*)/renew_attestation/(?P<user_id>[^/]*)$"
@defer.inlineCallbacks @defer.inlineCallbacks