Hal De 4 tahun lalu
induk
melakukan
769d404a73
2 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 1 1
      app/app.py
  2. 1 0
      app/utils.py

+ 1 - 1
app/app.py

@@ -564,7 +564,7 @@ class SetPresenceState(Resource):
     '''Sets user's presence state.
     Allowed states: not_set | unavailable | available | away | xa | chat | dnd
     '''
-    if state not in _pstates:
+    if state not in presenceStates:
       return invalidState(state)
     if user not in app.config['STATE_CACHE']['user']:
       return noUser(user)

+ 1 - 0
app/utils.py

@@ -22,6 +22,7 @@ _pstates = ['not_set',
             'dnd']
 # combinedStates[userstate][presencestate]=combinedState
 combinedStates = {_u: {_p: _states[_pstates.index(_p)][_ustates.index(_u)] for _p in _pstates} for _u in _ustates}
+presenceStates = _pstates
 NO_AUTH_ROUTES = ('/ui','/openapi.json','/favicon.ico')
 SWAGGER_JS_URL = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.37.2/swagger-ui-bundle.js"
 SWAGGER_CSS_URL = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.37.2/swagger-ui.min.css"