Fix typos

This commit is contained in:
Erik Johnston 2017-07-18 16:38:54 +01:00
parent 12ed4ee48e
commit 94ecd871a0
3 changed files with 22 additions and 12 deletions

View File

@ -495,7 +495,7 @@ class TransportLayerClient(object):
)
@log_function
def get_group_rooms(self, destination, group_id, requester_user_id):
def get_rooms_in_group(self, destination, group_id, requester_user_id):
path = PREFIX + "/groups/%s/rooms" % (group_id,)
return self.client.get_json(
@ -518,7 +518,7 @@ class TransportLayerClient(object):
)
@log_function
def get_group_users(self, destination, group_id, requester_user_id):
def get_users_in_group(self, destination, group_id, requester_user_id):
path = PREFIX + "/groups/%s/users" % (group_id,)
return self.client.get_json(

View File

@ -159,7 +159,7 @@ class GroupsLocalHandler(object):
)
defer.returnValue(res)
res = yield self.transport_client.get_group_users(
res = yield self.transport_client.get_users_in_group(
get_domain_from_id(group_id), group_id, requester_user_id,
)
@ -278,7 +278,8 @@ class GroupsLocalHandler(object):
else:
content["requester_user_id"] = requester_user_id
res = yield self.transport_client.remove_user_from_group(
get_domain_from_id(group_id), group_id, user_id, content
get_domain_from_id(group_id), group_id, requester_user_id,
user_id, content,
)
defer.returnValue(res)

View File

@ -776,7 +776,7 @@ class GroupServerStore(SQLBaseStore):
remote_attestation (dict): If remote group then store the remote
attestation from the group, else None.
"""
def _register_user_group_membership_txn(txn, next_id):
def _register_user_group_membership_txn(txn):
# TODO: Upsert?
self._simple_delete_txn(
txn,
@ -797,7 +797,6 @@ class GroupServerStore(SQLBaseStore):
"content": json.dumps(content),
},
)
self._group_updates_stream_cache.entity_has_changed(user_id, next_id)
# TODO: Insert profile to ensuer it comes down stream if its a join.
@ -820,7 +819,7 @@ class GroupServerStore(SQLBaseStore):
"group_id": group_id,
"user_id": user_id,
"valid_until_ms": remote_attestation["valid_until_ms"],
"attestation": json.dumps(remote_attestation),
"attestation_json": json.dumps(remote_attestation),
}
)
else:
@ -841,10 +840,9 @@ class GroupServerStore(SQLBaseStore):
},
)
with self._group_updates_id_gen.get_next() as next_id:
yield self.runInteraction(
"register_user_group_membership",
_register_user_group_membership_txn, next_id,
_register_user_group_membership_txn,
)
@defer.inlineCallbacks
@ -928,3 +926,14 @@ class GroupServerStore(SQLBaseStore):
defer.returnValue(json.loads(row["attestation_json"]))
defer.returnValue(None)
def get_joined_groups(self, user_id):
return self._simple_select_onecol(
table="local_group_membership",
keyvalues={
"user_id": user_id,
"membership": "join",
},
retcol="group_id",
desc="get_joined_groups",
)