mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 06:19:23 -05:00
apidocs: mtime_age > last_active_ago. Presence REST: Sanity check values in invite/drop arrays.
This commit is contained in:
parent
b50ea730b1
commit
dfea1730dc
@ -128,10 +128,10 @@
|
|||||||
"Presence": {
|
"Presence": {
|
||||||
"id": "Presence",
|
"id": "Presence",
|
||||||
"properties": {
|
"properties": {
|
||||||
"mtime_age": {
|
"last_active_ago": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "The last time this user's presence state changed, in milliseconds."
|
"description": "The last time this user performed an action on their home server."
|
||||||
},
|
},
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -125,12 +125,20 @@ class PresenceListRestServlet(RestServlet):
|
|||||||
|
|
||||||
if "invite" in content:
|
if "invite" in content:
|
||||||
for u in content["invite"]:
|
for u in content["invite"]:
|
||||||
|
if not isinstance(u, basestring):
|
||||||
|
raise SynapseError(400, "Bad invite value.")
|
||||||
|
if len(u) == 0:
|
||||||
|
continue
|
||||||
invited_user = self.hs.parse_userid(u)
|
invited_user = self.hs.parse_userid(u)
|
||||||
deferreds.append(self.handlers.presence_handler.send_invite(
|
deferreds.append(self.handlers.presence_handler.send_invite(
|
||||||
observer_user=user, observed_user=invited_user))
|
observer_user=user, observed_user=invited_user))
|
||||||
|
|
||||||
if "drop" in content:
|
if "drop" in content:
|
||||||
for u in content["drop"]:
|
for u in content["drop"]:
|
||||||
|
if not isinstance(u, basestring):
|
||||||
|
raise SynapseError(400, "Bad drop value.")
|
||||||
|
if len(u) == 0:
|
||||||
|
continue
|
||||||
dropped_user = self.hs.parse_userid(u)
|
dropped_user = self.hs.parse_userid(u)
|
||||||
deferreds.append(self.handlers.presence_handler.drop(
|
deferreds.append(self.handlers.presence_handler.drop(
|
||||||
observer_user=user, observed_user=dropped_user))
|
observer_user=user, observed_user=dropped_user))
|
||||||
|
Loading…
Reference in New Issue
Block a user