join plain text and rich text to one struct.

This commit is contained in:
Miroslav Šedivý 2021-01-29 20:05:13 +01:00
parent 5c9a57ee91
commit 546cd608c3
6 changed files with 63 additions and 62 deletions

View file

@ -38,14 +38,18 @@ func (h *RoomHandler) Route(r chi.Router) {
})
r.With(auth.HostsOnly).Route("/clipboard", func(r chi.Router) {
r.Get("/", h.clipboardGetPlainText)
r.Post("/", h.clipboardSetPlainText)
r.Get("/targets", h.clipboardGetTargets)
r.Get("/html", h.clipboardGetRichText)
r.Post("/html", h.clipboardSetRichText)
r.Get("/image", h.clipboardGetImage)
// TODO: Refactor.
r.Get("/", h.clipboardGetText)
r.Post("/", h.clipboardSetText)
r.Get("/image.png", h.clipboardGetImage)
// TODO: Refactor. xclip is failing to set propper target type
// and this content is sent back to client as text in another
// clipboard update. Therefore endpoint is not usable!
//r.Post("/image", h.clipboardSetImage)
// TODO: Refactor. If there would be implemented custom target
// retrieval, this endpoint would be useful.
//r.Get("/targets", h.clipboardGetTargets)
})
r.Route("/keyboard", func(r chi.Router) {