mirror of https://gitlab.com/litecord/litecord.git
blueprints.users: dispatch USER_NOTE_UPDATE
- gateway.websocket: show packet when bad op
This commit is contained in:
parent
e210c20d0f
commit
71d1adac53
|
|
@ -218,6 +218,11 @@ async def put_note(target_id: int):
|
||||||
WHERE user_id = $1 AND target_id = $2
|
WHERE user_id = $1 AND target_id = $2
|
||||||
""", user_id, target_id, note)
|
""", user_id, target_id, note)
|
||||||
|
|
||||||
|
await app.dispatcher.dispatch_user(user_id, 'USER_NOTE_UPDATE', {
|
||||||
|
'id': str(target_id),
|
||||||
|
'note': note,
|
||||||
|
})
|
||||||
|
|
||||||
return '', 204
|
return '', 204
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -747,6 +747,7 @@ class GatewayWebsocket:
|
||||||
try:
|
try:
|
||||||
handler = getattr(self, f'handle_{op_code}')
|
handler = getattr(self, f'handle_{op_code}')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
log.warning('Payload with bad op: {}', pprint.pformat(payload))
|
||||||
raise UnknownOPCode(f'Bad OP code: {op_code}')
|
raise UnknownOPCode(f'Bad OP code: {op_code}')
|
||||||
|
|
||||||
await handler(payload)
|
await handler(payload)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue