local peers should always be online
This commit is contained in:
parent
828705923c
commit
d799e690b5
4 changed files with 9 additions and 1 deletions
|
|
@ -117,6 +117,7 @@ def getUsers(data):
|
|||
'''
|
||||
users = []
|
||||
ids = set()
|
||||
local = set()
|
||||
for u in models.User.query.filter(models.User.id!=settings.USER_ID).all():
|
||||
users.append(u.json())
|
||||
ids.add(u.id)
|
||||
|
|
@ -127,6 +128,10 @@ def getUsers(data):
|
|||
n['online'] = True
|
||||
n['name'] = n['username']
|
||||
users.append(n)
|
||||
local.add(id)
|
||||
for n in users:
|
||||
n['local'] = n['id'] in local
|
||||
|
||||
users.sort(key=lambda u: ox.sort_string(str(u.get('index', '')) + 'Z' + (u.get('name') or '')))
|
||||
return {
|
||||
"users": users
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue