mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
hicli/json: handle ping commands
This commit is contained in:
parent
99ce4618c6
commit
9e796dd66c
1 changed files with 6 additions and 0 deletions
|
|
@ -70,6 +70,12 @@ func (h *HiClient) dispatchCurrentState() {
|
|||
}
|
||||
|
||||
func (h *HiClient) SubmitJSONCommand(ctx context.Context, req *JSONCommand) *JSONCommand {
|
||||
if req.Command == "ping" {
|
||||
return &JSONCommand{
|
||||
Command: "pong",
|
||||
RequestID: req.RequestID,
|
||||
}
|
||||
}
|
||||
log := h.Log.With().Int64("request_id", req.RequestID).Str("command", req.Command).Logger()
|
||||
ctx, cancel := context.WithCancelCause(ctx)
|
||||
defer func() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue